Skip to content

TypeScript compiler fails in ES5 environment #28918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arktronic opened this issue Dec 8, 2018 · 2 comments
Closed

TypeScript compiler fails in ES5 environment #28918

arktronic opened this issue Dec 8, 2018 · 2 comments
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@arktronic
Copy link

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).

@j-oliveras
Copy link
Contributor

j-oliveras commented Dec 8, 2018

@DanielRosenwasser
Copy link
Member

Thanks everyone!

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants