add higher priority to exponent operator, better async contextual functions
This commit is contained in:
parent
29a4dcc975
commit
8c25cb0d80
10
acorn.js
10
acorn.js
@ -469,7 +469,7 @@
|
||||
|
||||
// '*' may be multiply or have special meaning in ES6
|
||||
var _star = {binop: 10, beforeExpr: true};
|
||||
var _exponent = {binop: 10, beforeExpr: true};
|
||||
var _exponent = {binop: 11, beforeExpr: true};
|
||||
|
||||
// '<', '>' may be relational or have special meaning in JSX
|
||||
var _lt = {binop: 7, beforeExpr: true}, _gt = {binop: 7, beforeExpr: true};
|
||||
@ -2618,12 +2618,8 @@
|
||||
|
||||
// normal functions
|
||||
if (tokType === _function) {
|
||||
if (isStatement) {
|
||||
// no line terminator after `async` contextual keyword
|
||||
if (tokType === _semi || canInsertSemicolon()) {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
// no line terminator after `async` contextual keyword
|
||||
if (canInsertSemicolon()) return id;
|
||||
|
||||
next();
|
||||
return parseFunction(node, isStatement, true);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "acorn-6to5",
|
||||
"description": "Acorn fork used by 6to5",
|
||||
"main": "acorn.js",
|
||||
"version": "0.11.1-10",
|
||||
"version": "0.11.1-11",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Marijn Haverbeke",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user