File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed
Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -3350,6 +3350,14 @@ The WASI instance has already started.
33503350
33513351The WASI instance has not been started.
33523352
3353+ <a id =" ERR_WEBASSEMBLY_NOT_SUPPORTED " ></a >
3354+
3355+ ### ` ERR_WEBASSEMBLY_NOT_SUPPORTED `
3356+
3357+ A feature requiring WebAssembly was used, but WebAssembly is not supported or
3358+ has been disabled in the current environment (for example, when running with
3359+ ` --jitless ` ). The error message specifies which feature requires WebAssembly.
3360+
33533361<a id =" ERR_WEBASSEMBLY_RESPONSE " ></a >
33543362
33553363### ` ERR_WEBASSEMBLY_RESPONSE `
Original file line number Diff line number Diff line change @@ -1905,6 +1905,9 @@ E('ERR_VM_MODULE_NOT_MODULE',
19051905 'Provided module is not an instance of Module' , Error ) ;
19061906E ( 'ERR_VM_MODULE_STATUS' , 'Module status %s' , Error ) ;
19071907E ( 'ERR_WASI_ALREADY_STARTED' , 'WASI instance has already started' , Error ) ;
1908+ E ( 'ERR_WEBASSEMBLY_NOT_SUPPORTED' ,
1909+ 'WebAssembly is not supported in this environment, but is required for %s' ,
1910+ Error ) ;
19081911E ( 'ERR_WEBASSEMBLY_RESPONSE' , 'WebAssembly response %s' , TypeError ) ;
19091912E ( 'ERR_WORKER_INIT_FAILED' , 'Worker initialization failure: %s' , Error ) ;
19101913E ( 'ERR_WORKER_INVALID_EXEC_ARGV' , ( errors , msg = 'invalid execArgv flags' ) =>
Original file line number Diff line number Diff line change @@ -46,12 +46,14 @@ const {
4646 SymbolPrototypeGetDescription,
4747 SymbolReplace,
4848 SymbolSplit,
49+ globalThis,
4950} = primordials ;
5051
5152const {
5253 codes : {
5354 ERR_NO_CRYPTO ,
5455 ERR_NO_TYPESCRIPT ,
56+ ERR_WEBASSEMBLY_NOT_SUPPORTED ,
5557 ERR_UNKNOWN_SIGNAL ,
5658 } ,
5759 isErrorStackTraceLimitWritable,
@@ -244,6 +246,8 @@ function assertCrypto() {
244246function assertTypeScript ( ) {
245247 if ( noTypeScript )
246248 throw new ERR_NO_TYPESCRIPT ( ) ;
249+ if ( globalThis . WebAssembly === undefined )
250+ throw new ERR_WEBASSEMBLY_NOT_SUPPORTED ( 'TypeScript' ) ;
247251}
248252
249253/**
Original file line number Diff line number Diff line change @@ -342,3 +342,14 @@ test('check transform types warning', async () => {
342342 assert . match ( result . stdout , / H e l l o , T y p e S c r i p t ! / ) ;
343343 assert . strictEqual ( result . code , 0 ) ;
344344} ) ;
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 , / E R R _ W E B A S S E M B L Y _ N O T _ S U P P O R T E D / ) ;
353+ assert . match ( result . stderr , / W e b A s s e m b l y i s n o t s u p p o r t e d i n t h i s e n v i r o n m e n t , b u t i s r e q u i r e d f o r T y p e S c r i p t / ) ;
354+ assert . strictEqual ( result . code , 1 ) ;
355+ } ) ;
You can’t perform that action at this time.
0 commit comments