-
Notifications
You must be signed in to change notification settings - Fork 3.4k
MODULARIZE / scriptDirectory improvements #6914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tests/test_browser.py
Outdated
''') | ||
|
||
self.run_browser('test-subdir.html', None, '/report_result?0') | ||
for instance in (0, 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather make a list of tuples or something like that here. Looks hacky and takes more brain cycles to comprehend than necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I rewrote them that way, let me know what you think.
tests/test_browser.py
Outdated
'new Module();' | ||
): | ||
print(creation) | ||
for instance in (0, 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same idea here as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better every time 👍
new Module()
(instead of justModule()
) in finding the scriptDirectory. This is done by avoiding.bind()
, and saving it in a closure. This seems like a potential common pitfall, so worth supporting even if it isn't the documented use (see Regression in modularize mode (currentSrc issue) #6903)._scriptDir
code for MODULARIZE_INSTANCE - we only need it in MODULARIZE.emcc.py
code, do the extra scriptDirectory or instance stuff later, which I think is clearer.cc @nazar-pc