Skip to content

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

Merged
merged 8 commits into from
Jul 28, 2018
Merged

MODULARIZE / scriptDirectory improvements #6914

merged 8 commits into from
Jul 28, 2018

Conversation

kripken
Copy link
Member

@kripken kripken commented Jul 27, 2018

  • Support new Module() (instead of just Module()) 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).
  • Don't emit the _scriptDir code for MODULARIZE_INSTANCE - we only need it in MODULARIZE.
  • Refactor the emcc.py code, do the extra scriptDirectory or instance stuff later, which I think is clearer.
  • Add testing for MODULARIZE_INSTANCE and scriptDirectory detection.

cc @nazar-pc

''')

self.run_browser('test-subdir.html', None, '/report_result?0')
for instance in (0, 1):
Copy link
Contributor

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.

Copy link
Member Author

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.

'new Module();'
):
print(creation)
for instance in (0, 1):
Copy link
Contributor

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.

Copy link
Contributor

@nazar-pc nazar-pc left a 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 👍

@kripken kripken merged commit 02e3c36 into incoming Jul 28, 2018
@kripken kripken deleted the newModularize branch July 28, 2018 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants