Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 9877e98

Browse files
authored
Breaking: Support TypeScript 2.5 (fixes #368) (#369) (#370)
1 parent 5b49870 commit 9877e98

File tree

10 files changed

+1090
-3
lines changed

10 files changed

+1090
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A parser that converts TypeScript into an [ESTree](https://github.com/estree/est
88

99
We will always endeavor to support the latest stable version of TypeScript.
1010

11-
The version of TypeScript currently supported by this parser is `~2.4.0`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
11+
The version of TypeScript currently supported by this parser is `~2.5.1`. This is reflected in the `devDependency` requirement within the package.json file, and it is what the tests will be run against. We have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
1212

1313
If you use a non-supported version of TypeScript, the parser will log a warning to the console.
1414

lib/ast-node-types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ module.exports = {
124124
TSModuleDeclaration: "TSModuleDeclaration",
125125
TSNamespaceFunctionDeclaration: "TSNamespaceFunctionDeclaration",
126126
TSNonNullExpression: "TSNonNullExpression",
127+
TSNeverKeyword: "TSNeverKeyword",
127128
TSNullKeyword: "TSNullKeyword",
128129
TSNumberKeyword: "TSNumberKeyword",
129130
TSObjectKeyword: "TSObjectKeyword",

lib/convert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ module.exports = function convert(config) {
528528
case SyntaxKind.CatchClause:
529529
Object.assign(result, {
530530
type: AST_NODE_TYPES.CatchClause,
531-
param: convertChild(node.variableDeclaration.name),
531+
param: node.variableDeclaration ? convertChild(node.variableDeclaration.name) : null,
532532
body: convertChild(node.block)
533533
});
534534
break;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"npm-license": "0.3.3",
3131
"shelljs": "0.7.8",
3232
"shelljs-nodecli": "0.1.1",
33-
"typescript": "~2.4.0"
33+
"typescript": "~2.5.1"
3434
},
3535
"keywords": [
3636
"ast",

tests/ast-alignment/spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ const fixturePatternsToTest = [
473473
"typescript/basics/class-with-generic-method-default.src.ts",
474474
"typescript/basics/class-with-generic-method.src.ts",
475475
"typescript/basics/type-guard.src.ts",
476+
"typescript/basics/never-type-param.src.ts",
476477
{
477478
pattern: "typescript/basics/export-named-enum.src.ts",
478479
config: { babylonParserOptions: { sourceType: "module" } }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
try {} catch {} finally {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
try {} catch {}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const x: X<never>;
2+
Observable.empty<never>();

0 commit comments

Comments
 (0)