Skip to content

Allow to run TypeScript (Services) in strict mode #10755

Closed

Description

Hi,
this is a follow-up issue to #9449.

TypeScript Version: master (4685646)

After PR #9353 has been merged, typescriptServices.js (in this case) again cannot be run in strict mode due to using the identifier package in services.ts, which is a reserved word in strict mode:

C:\Users\VPC\Desktop\TypeScript\built\local>node --use_strict typescriptServices.js
C:\Users\VPC\Desktop\TypeScript\built\local\typescriptServices.js:68849
                        var package = _d[_c];
                            ^^^^^^^
SyntaxError: Unexpected strict mode reserved word

(running current master)

As Herrington Darkholme (@HerringtonDarkholme) noted, this causes an error in the Closure Compiler.

Now that TSC requires at least ES5 (#10125), might there be an option to add "use strict"; to the ts files of the TypeScript repo? This should prevent using such reserved identifiers.

Thanks!

Activity

  1. added a commit that references this issue on Sep 7, 2016
    9ee897a
  2. mhegazy commented on Sep 7, 2016

    @mhegazy
    Contributor

    I have a fix to remove the use of package in #10757. the longer term change is to add a new flag to parse a project in strict mode.

  3. added a commit that references this issue on Sep 7, 2016
    c16ae3e
  4. kpreisser commented on Sep 7, 2016

    @kpreisser
    ContributorAuthor

    Thanks!

  5. mhegazy commented on Sep 7, 2016

    @mhegazy
    Contributor

    Filed #10758 to track adding the compiler option.

  6. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions