Skip to content
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

Allow to run TypeScript (Compiler, Services) in strict mode #9449

Closed
kpreisser opened this issue Jun 30, 2016 · 2 comments
Closed

Allow to run TypeScript (Compiler, Services) in strict mode #9449

kpreisser opened this issue Jun 30, 2016 · 2 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@kpreisser
Copy link
Contributor

kpreisser commented Jun 30, 2016

TypeScript Version: master

Currently, tsc.js, typescriptServices.js and tsserver.js cannot be run in a strict mode environment due to using the identifier static in checker.ts.

static is a reserved identifier in strict mode, so if you run tsc.js with Node in strict mode, it will fail:

C:\Users\VPC\Desktop\TypeScriptOrg\built\local>node --use_strict tsc.js
C:\Users\VPC\Desktop\TypeScriptOrg\built\local\tsc.js:24019
                    var static = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
                        ^^^^^^
SyntaxError: Unexpected strict mode reserved word

I think it is reasonable to allow TypeScript to be run in a strict mode environment, by changing the name of the variable.

PS: Is there a reason why the TypeScript sources don't use strict mode in general?
Thanks!

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Jun 30, 2016
@mhegazy mhegazy modified the milestone: Community Jun 30, 2016
@mhegazy mhegazy self-assigned this Jun 30, 2016
@HerringtonDarkholme
Copy link
Contributor

I also encounter this when trying to compress typescript services using Closure compiler.

@mhegazy can I submit a pull request for this? Or you prefer to do it yourself?

@mhegazy
Copy link
Contributor

mhegazy commented Jul 1, 2016

thanks @HerringtonDarkholme.

@mhegazy mhegazy added this to the TypeScript 2.0 milestone Jul 1, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jul 1, 2016
@mhegazy mhegazy removed their assignment Jul 1, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants