Skip to content

MODULARIZE / scriptDirectory improvements - #6914

Merged
kripken merged 8 commits into
incomingfrom
newModularize
Jul 28, 2018
Merged

kripken merged 8 commits into
incomingfrom
newModularize

Conversation

@kripken

@kripken kripken commented Jul 27, 2018 •

Copy link
Copy Markdown
Member
  • 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

Comment thread tests/test_browser.py Outdated
''')

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

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread tests/test_browser.py Outdated
'new Module();'
):
print(creation)
for instance in (0, 1):

Copy link
Copy Markdown
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.

@nazar-pc nazar-pc left a comment

Copy link
Copy Markdown
Contributor

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