Skip to content

Commit

Permalink
fix cycle binding updates for expressions (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Apr 27, 2024
1 parent f24d23f commit dd969e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit dd969e7

Please sign in to comment.