Closed
Description
The TypeScript compiler fails to run in the latest stable version of Jint (an ES5 environment) as of version 3.1 and above. The apparent issue is the use of Set
, which does not exist prior to ES2015. Additional context tweet.
TypeScript Version: 3.2.2
Code
Executing the compiler in Jint issue reproduction
The repro app executes the same trivial compilation code against TypeScript 3.0.3, which works, and then 3.2.2, which fails. The failure occurs while executing the typescriptServices
JS file itself, not while running the ts.transpileModule
code.
Output from repro app:
--Works--
Result: var x = 'string';
--Fails--
Exception: ReferenceError: Set is not defined
Expected behavior:
Compiler executes successfully in Jint.
Actual behavior:
Jint throws an exception (see above for exception message).