| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dd5f835 commit b56d8af
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -537,7 +537,7 @@ class ModuleLoader { | |||
| 537 | 537 | * matching translators. | |
| 538 | 538 | * @param {ModuleSource} source Source of the module to be translated. | |
| 539 | 539 | * @param {boolean} isMain Whether the module to be translated is the entry point. | |
| 540 | - * @returns {ModuleWrap | Promise<ModuleWrap>} | ||
| 540 | + * @returns {ModuleWrap} | ||
| 541 | 541 | */ | |
| 542 | 542 | #translate(url, format, source, isMain) { | |
| 543 | 543 | this.validateLoadResult(url, format); | |
@@ -547,7 +547,9 @@ class ModuleLoader { | |||
| 547 | 547 | throw new ERR_UNKNOWN_MODULE_FORMAT(format, url); | |
| 548 | 548 | } | |
| 549 | 549 | ||
| 550 | - return FunctionPrototypeCall(translator, this, url, source, isMain); | ||
| 550 | + const result = FunctionPrototypeCall(translator, this, url, source, isMain); | ||
| 551 | + assert(result instanceof ModuleWrap); | ||
| 552 | + return result; | ||
| 551 | 553 | } | |
| 552 | 554 | ||
| 553 | 555 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -494,18 +494,14 @@ translators.set('json', function jsonStrategy(url, source) { | |||
| 494 | 494 | * >} [[Instance]] slot proxy for WebAssembly Module Record | |
| 495 | 495 | */ | |
| 496 | 496 | const wasmInstances = new SafeWeakMap(); | |
| 497 | - translators.set('wasm', async function(url, source) { | ||
| 497 | + translators.set('wasm', function(url, source) { | ||
| 498 | 498 | assertBufferSource(source, false, 'load'); | |
| 499 | 499 | ||
| 500 | 500 | debug(`Translating WASMModule ${url}`); | |
| 501 | 501 | ||
| 502 | 502 | let compiled; | |
| 503 | 503 | try { | |
| 504 | - // TODO(joyeecheung): implement a translator that just uses | ||
| 505 | - // compiled = new WebAssembly.Module(source) to compile it | ||
| 506 | - // synchronously. | ||
| 507 | - compiled = await WebAssembly.compile(source, { | ||
| 508 | - // The ESM Integration auto-enables Wasm JS builtins by default when available. | ||
| 504 | + compiled = new WebAssembly.Module(source, { | ||
| 509 | 505 | builtins: ['js-string'], | |
| 510 | 506 | }); | |
| 511 | 507 | } catch (err) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments