| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 85b8d25 commit 8c4dcd5
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -527,7 +527,7 @@ class ModuleLoader { | |||
| 527 | 527 | * matching translators. | |
| 528 | 528 | * @param {ModuleSource} source Source of the module to be translated. | |
| 529 | 529 | * @param {boolean} isMain Whether the module to be translated is the entry point. | |
| 530 | - * @returns {ModuleWrap | Promise<ModuleWrap>} | ||
| 530 | + * @returns {ModuleWrap} | ||
| 531 | 531 | */ | |
| 532 | 532 | #translate(url, format, source, isMain) { | |
| 533 | 533 | this.validateLoadResult(url, format); | |
@@ -537,7 +537,9 @@ class ModuleLoader { | |||
| 537 | 537 | throw new ERR_UNKNOWN_MODULE_FORMAT(format, url); | |
| 538 | 538 | } | |
| 539 | 539 | ||
| 540 | - return FunctionPrototypeCall(translator, this, url, source, isMain); | ||
| 540 | + const result = FunctionPrototypeCall(translator, this, url, source, isMain); | ||
| 541 | + assert(result instanceof ModuleWrap); | ||
| 542 | + return result; | ||
| 541 | 543 | } | |
| 542 | 544 | ||
| 543 | 545 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -432,17 +432,14 @@ translators.set('json', function jsonStrategy(url, source) { | |||
| 432 | 432 | * >} [[Instance]] slot proxy for WebAssembly Module Record | |
| 433 | 433 | */ | |
| 434 | 434 | const wasmInstances = new SafeWeakMap(); | |
| 435 | - translators.set('wasm', async function(url, source) { | ||
| 435 | + translators.set('wasm', function(url, source) { | ||
| 436 | 436 | assertBufferSource(source, false, 'load'); | |
| 437 | 437 | ||
| 438 | 438 | debug(`Translating WASMModule ${url}`); | |
| 439 | 439 | ||
| 440 | 440 | let compiled; | |
| 441 | 441 | try { | |
| 442 | - // TODO(joyeecheung): implement a translator that just uses | ||
| 443 | - // compiled = new WebAssembly.Module(source) to compile it | ||
| 444 | - // synchronously. | ||
| 445 | - compiled = await WebAssembly.compile(source, { | ||
| 442 | + compiled = new WebAssembly.Module(source, { | ||
| 446 | 443 | builtins: ['js-string'], | |
| 447 | 444 | }); | |
| 448 | 445 | } catch (err) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments