Skip to content

Commit

Permalink
babel-parser: typescript: add missing bigint keyword (#9230)
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 authored and existentialism committed Dec 22, 2018
1 parent d1aa665 commit b5177ce
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/babel-parser/src/plugins/typescript.js
Expand Up @@ -45,6 +45,8 @@ function keywordTypeFromName(
return "TSAnyKeyword";
case "boolean":
return "TSBooleanKeyword";
case "bigint":
return "TSBigIntKeyword";
case "never":
return "TSNeverKeyword";
case "number":
Expand Down
1 change: 1 addition & 0 deletions packages/babel-parser/src/types.js
Expand Up @@ -1157,6 +1157,7 @@ export type TsKeywordTypeType =
| "TSNumberKeyword"
| "TSObjectKeyword"
| "TSBooleanKeyword"
| "TSBigIntKeyword"
| "TSStringKeyword"
| "TSSymbolKeyword"
| "TSVoidKeyword"
Expand Down
Expand Up @@ -9,3 +9,4 @@ let st: string;
let sy: symbol;
let u: undefined;
let v: void;
let n: bigint;
@@ -1,29 +1,29 @@
{
"type": "File",
"start": 0,
"end": 169,
"end": 184,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 11,
"column": 12
"line": 12,
"column": 14
}
},
"program": {
"type": "Program",
"start": 0,
"end": 169,
"end": 184,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 11,
"column": 12
"line": 12,
"column": 14
}
},
"sourceType": "module",
Expand Down Expand Up @@ -919,6 +919,87 @@
}
],
"kind": "let"
},
{
"type": "VariableDeclaration",
"start": 170,
"end": 184,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 12,
"column": 14
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 174,
"end": 183,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 13
}
},
"id": {
"type": "Identifier",
"start": 174,
"end": 183,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 13
},
"identifierName": "n"
},
"name": "n",
"typeAnnotation": {
"type": "TSTypeAnnotation",
"start": 175,
"end": 183,
"loc": {
"start": {
"line": 12,
"column": 5
},
"end": {
"line": 12,
"column": 13
}
},
"typeAnnotation": {
"type": "TSBigIntKeyword",
"start": 177,
"end": 183,
"loc": {
"start": {
"line": 12,
"column": 7
},
"end": {
"line": 12,
"column": 13
}
}
}
}
},
"init": null
}
],
"kind": "let"
}
],
"directives": []
Expand Down

0 comments on commit b5177ce

Please sign in to comment.