From 37d4748c79d4fcfea85859e5e4816ec3dee28573 Mon Sep 17 00:00:00 2001 From: Reyad Attiyat Date: Fri, 17 Feb 2017 16:00:30 -0600 Subject: [PATCH] Fix: Await node should have argument property (fixes #160) The await node should have an argument property instead of an expression property to be a valid estree node. --- lib/ast-converter.js | 2 +- tests/fixtures/typescript/basics/function-with-await.result.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ast-converter.js b/lib/ast-converter.js index d80df39..b978b90 100644 --- a/lib/ast-converter.js +++ b/lib/ast-converter.js @@ -1355,7 +1355,7 @@ module.exports = function(ast, extra) { case SyntaxKind.AwaitExpression: assign(result, { type: "AwaitExpression", - expression: convertChild(node.expression) + argument: convertChild(node.expression) }); break; diff --git a/tests/fixtures/typescript/basics/function-with-await.result.js b/tests/fixtures/typescript/basics/function-with-await.result.js index cc03d87..f9e54ea 100644 --- a/tests/fixtures/typescript/basics/function-with-await.result.js +++ b/tests/fixtures/typescript/basics/function-with-await.result.js @@ -51,7 +51,7 @@ module.exports = { "type": "ExpressionStatement", "expression": { "type": "AwaitExpression", - "expression": { + "argument": { "type": "Identifier", "loc": { "end": {