Skip to content

After parsing identifiers that start with two underscore another underscore is prepended #14013

Closed
@soda0289

Description

@soda0289

TypeScript Version: 2.1.5

Code

console.log(__dirname);

Expected behavior:
When the above typescript is parsed into an AST I would expect the Identifier of the function argument __dirname to start with two underscores.

Actual behavior:

AST Example here:
https://astexplorer.net/#/gist/7b4386c740b3ba88a996a6f644a215c8/857121c5ac1b3cba6edb0ee8c499cb66e9919772

Identifiers prefixed with one underscore are parsed correctly, so are identifiers prefixed with three underscores.

These bugs are probably related:
#11902
#3268

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptDesign LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions