acorn-es7-plugin
Advanced tools
Comparing version 1.1.6 to 1.1.7
@@ -121,3 +121,3 @@ var NotAsync = {} ; | ||
parser.extend("parseExprAtom",function(base){ | ||
parser.extend("parseExprAtom",function(base){ | ||
return function(refShorthandDefaultPos){ | ||
@@ -158,2 +158,4 @@ var start = this.start ; | ||
rhs = rhs.expressions[0] ; | ||
if (rhs.type === 'CallExpression') | ||
rhs = rhs.callee ; | ||
if (rhs.type==='FunctionExpression' || rhs.type==='FunctionDeclaration' || rhs.type==='ArrowFunctionExpression') { | ||
@@ -165,2 +167,5 @@ // Because we don't know if the top level parser supprts preserveParens, we have to re-parse | ||
rhs = rhs.expressions[0] ; | ||
if (rhs.type === 'CallExpression') | ||
rhs = rhs.callee ; | ||
rhs.async = true ; | ||
@@ -167,0 +172,0 @@ rhs.start = start; |
@@ -28,3 +28,3 @@ { | ||
}, | ||
"version": "1.1.6" | ||
"version": "1.1.7" | ||
} |
@@ -110,2 +110,6 @@ [![NPM](https://nodei.co/npm/acorn-es7-plugin.png?downloads=true&downloadRank=true)](https://nodei.co/npm/acorn-es7-plugin/) | ||
30-Mar-17: v1.1.7 | ||
- Fix parsing of IIAFE `(async function (){ }())` with acorn v3. | ||
07-Oct-16: v1.1.1 | ||
@@ -112,0 +116,0 @@ |
@@ -48,2 +48,20 @@ 'use strict'; | ||
},{ | ||
desc: "Simple async function expression", | ||
code: "(async function (){ })", | ||
pass: function (ast) { | ||
return ast.body[0].expression.async === true; | ||
} | ||
},{ | ||
desc: "Async function expression call (1)", | ||
code: "(async function (){ }())", | ||
pass: function (ast) { | ||
return ast.body[0].expression.callee.async === true; | ||
} | ||
},{ | ||
desc: "Async function expression call (2)", | ||
code: "(async function (){ })()", | ||
pass: function (ast) { | ||
return ast.body[0].expression.callee.async === true; | ||
} | ||
},{ | ||
desc: "Await in async is AwaitExpression", | ||
@@ -50,0 +68,0 @@ code: "async function x() { await(undefined); await undefined ; }", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60571
13
1418
165