Skip to content
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

fix cycle binding updates for expressions #421

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ In shim mode, Wasm modules are always supported. In polyfill mode, Wasm modules

WebAssembly module exports are made available as module exports and WebAssembly module imports will be resolved using the browser module loader.

When using the source phase import form, this must be enabled separately via the `polyfillEnabe: ['wasm-modules', 'source-phase']` [init option](#polyfill-enable-option) to support source imports to WebAssembly modules.
When using the source phase import form, this must be enabled separately via the `polyfillEnable: ['wasm-modules', 'source-phase']` [init option](#polyfill-enable-option) to support source imports to WebAssembly modules.

When enabling `'source-phase'`, `WebAssembly.Module` is also polyfilled to extend from `AbstractModuleSource` per the source phase proposal.

Expand Down
2 changes: 1 addition & 1 deletion src/es-module-shims.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ function resolveDeps (load, seen) {
}

// support progressive cycle binding updates (try statement avoids tdz errors)
if (load.s)
if (load.s && (imports.length === 0 || imports[imports.length - 1].d === -1))
resolvedSource += `\n;import{u$_}from'${load.s}';try{u$_({${exports.filter(e => e.ln).map(({ s, e, ln }) => `${source.slice(s, e)}:${ln}`).join(',')}})}catch(_){};\n`;

function pushSourceURL (commentPrefix, commentStart) {
Expand Down
Loading