add higher priority to exponent operator, better async contextual functions

This commit is contained in:
Sebastian McKenzie 2015-01-06 10:42:57 +11:00
parent 29a4dcc975
commit 8c25cb0d80
2 changed files with 4 additions and 8 deletions

View File

@ -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);

View File

@ -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",