| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 078cfa2 commit 8de391e
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3346,6 +3346,14 @@ The WASI instance has already started. | |||
| 3346 | 3346 | ||
| 3347 | 3347 | The WASI instance has not been started. | |
| 3348 | 3348 | ||
| 3349 | + <a id="ERR_WEBASSEMBLY_NOT_SUPPORTED"></a> | ||
| 3350 | + | ||
| 3351 | + ### `ERR_WEBASSEMBLY_NOT_SUPPORTED` | ||
| 3352 | + | ||
| 3353 | + A feature requiring WebAssembly was used, but WebAssembly is not supported or | ||
| 3354 | + has been disabled in the current environment (for example, when running with | ||
| 3355 | + `--jitless`). The error message specifies which feature requires WebAssembly. | ||
| 3356 | + | ||
| 3349 | 3357 | <a id="ERR_WEBASSEMBLY_RESPONSE"></a> | |
| 3350 | 3358 | ||
| 3351 | 3359 | ### `ERR_WEBASSEMBLY_RESPONSE` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1892,6 +1892,9 @@ E('ERR_VM_MODULE_NOT_MODULE', | |||
| 1892 | 1892 | 'Provided module is not an instance of Module', Error); | |
| 1893 | 1893 | E('ERR_VM_MODULE_STATUS', 'Module status %s', Error); | |
| 1894 | 1894 | E('ERR_WASI_ALREADY_STARTED', 'WASI instance has already started', Error); | |
| 1895 | + E('ERR_WEBASSEMBLY_NOT_SUPPORTED', | ||
| 1896 | + 'WebAssembly is not supported in this environment, but is required for %s', | ||
| 1897 | + Error); | ||
| 1895 | 1898 | E('ERR_WEBASSEMBLY_RESPONSE', 'WebAssembly response %s', TypeError); | |
| 1896 | 1899 | E('ERR_WORKER_INIT_FAILED', 'Worker initialization failure: %s', Error); | |
| 1897 | 1900 | E('ERR_WORKER_INVALID_EXEC_ARGV', (errors, msg = 'invalid execArgv flags') => | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,13 +45,15 @@ const { | |||
| 45 | 45 | SymbolPrototypeGetDescription, | |
| 46 | 46 | SymbolReplace, | |
| 47 | 47 | SymbolSplit, | |
| 48 | + globalThis, | ||
| 48 | 49 | } = primordials; | |
| 49 | 50 | ||
| 50 | 51 | const { | |
| 51 | 52 | codes: { | |
| 52 | 53 | ERR_NO_CRYPTO, | |
| 53 | 54 | ERR_NO_TYPESCRIPT, | |
| 54 | 55 | ERR_UNKNOWN_SIGNAL, | |
| 56 | + ERR_WEBASSEMBLY_NOT_SUPPORTED, | ||
| 55 | 57 | }, | |
| 56 | 58 | isErrorStackTraceLimitWritable, | |
| 57 | 59 | overrideStackTrace, | |
@@ -242,6 +244,8 @@ function assertCrypto() { | |||
| 242 | 244 | function assertTypeScript() { | |
| 243 | 245 | if (noTypeScript) | |
| 244 | 246 | throw new ERR_NO_TYPESCRIPT(); | |
| 247 | + if (globalThis.WebAssembly === undefined) | ||
| 248 | + throw new ERR_WEBASSEMBLY_NOT_SUPPORTED('TypeScript'); | ||
| 245 | 249 | } | |
| 246 | 250 | ||
| 247 | 251 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -342,3 +342,14 @@ test('check transform types warning', async () => { | |||
| 342 | 342 | assert.match(result.stdout, /Hello, TypeScript!/); | |
| 343 | 343 | assert.strictEqual(result.code, 0); | |
| 344 | 344 | }); | |
| 345 | + | ||
| 346 | + test('expect error when executing a TypeScript file with --jitless', async () => { | ||
| 347 | + const result = await spawnPromisified(process.execPath, [ | ||
| 348 | + '--jitless', | ||
| 349 | + fixtures.path('typescript/ts/test-typescript.ts'), | ||
| 350 | + ]); | ||
| 351 | + | ||
| 352 | + assert.match(result.stderr, /ERR_WEBASSEMBLY_NOT_SUPPORTED/); | ||
| 353 | + assert.match(result.stderr, /WebAssembly is not supported in this environment, but is required for TypeScript/); | ||
| 354 | + assert.strictEqual(result.code, 1); | ||
| 355 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments