add ecmaVersion check to async function statements
This commit is contained in:
parent
56bc618d33
commit
c8fc778ffb
2
acorn.js
2
acorn.js
@ -2043,7 +2043,7 @@
|
|||||||
// next token is a colon and the expression was a simple
|
// next token is a colon and the expression was a simple
|
||||||
// Identifier node, we switch to interpreting it as a label.
|
// Identifier node, we switch to interpreting it as a label.
|
||||||
default:
|
default:
|
||||||
if (tokType === _name && tokVal === "async") {
|
if (options.ecmaVersion >= 7 && tokType === _name && tokVal === "async") {
|
||||||
var id = parseIdent();
|
var id = parseIdent();
|
||||||
if (tokType === _function) {
|
if (tokType === _function) {
|
||||||
next();
|
next();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "acorn-6to5",
|
"name": "acorn-6to5",
|
||||||
"description": "Acorn fork used by 6to5",
|
"description": "Acorn fork used by 6to5",
|
||||||
"main": "acorn.js",
|
"main": "acorn.js",
|
||||||
"version": "0.11.1-2",
|
"version": "0.11.1-3",
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
{
|
{
|
||||||
"name": "Marijn Haverbeke",
|
"name": "Marijn Haverbeke",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user