-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Copy the wasm exports object if we intend to modify it #8950
base: main
Are you sure you want to change the base?
Conversation
src/preamble.js
Outdated
// To work around that, we simply make a copy of them. | ||
#if EXPORT_ES6 && (ASSERTIONS || BYSYNCIFY) | ||
var originalExports = exports; | ||
for (var x in originalexports) exports[x] = originalExports[x]; |
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.
originalexports should have capital E
Sorry, doesn't fix the issue for me. I still get
I am still compiling with the old backend ( |
Thanks for the comments, I fixed those issues and tried to add a test. But the test is still not valid, as it passes even without this fix. @VirtualTim you say you still see the bug - is the test not written properly to catch what you are doing to hit it? |
(which backend is used should not affect this, I don't think, and I see the test passes in both backends) |
This isn't related to the real issue, but the tests pass locally for me but fail on CI. It's like on CI there is no support for es6 modules, even though based on caniuse there should be. I guess we need a flag or something? |
I figured out the problem with the test, the issue is only there when a thread/webworker is created, so you'll need to add |
Unfortunately this has revealed that After fixing that I'm still getting Line 140 in 16edbe5
That one is also easy to fix, that line just shouldn't be there in However the biggest issue is that Module overrides don't appear to work in I hope that all makes sense? |
|
||
@requires_threads | ||
def test_es6_threads(self): | ||
# TODO: use PROXY_TO_PTHREAD and/or '-s', 'PTHREAD_POOL_SIZE=1' once https://bugs.chromium.org/p/chromium/issues/detail?id=680046 is fixed |
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.
This should work on Chrome if --enable-experimental-web-platform-features
is set (sorry, forgot to mention that).
The Firefox bug is also: https://bugzilla.mozilla.org/show_bug.cgi?id=1540913
The deletion of the Re-opening and re-targeting to master. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
It looks like this PR has been superseded by #8926. Although, the Firefox bug mentioned by @VirtualTim is still not fixed and prevents the Should I open a new issue to track that? Not sure if we should track Firefox issues, but maybe we should document that somehow. |
@kleisauke if you're interested in getting this working in Firefox, I managed to get my use case working by using a custom build of Shimport 1.0.1 containing the fix mentioned here. |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
That makes it work if it is the ES6 exports object of a wasm module, which is read-only.
Fixes #8678 and also bysyncify in ES6 environments.
@VirtualTim - thoughts? Also, I am having a hard time writing a testcase for this - I'm not really familiar with ES6 modules I guess, so I haven't added a test or verified this works yet. Help would be welcome :)