diff --git a/acorn_loose.js b/acorn_loose.js index 1c6fb46fd6..b7bc56dd4f 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -606,7 +606,7 @@ if (curLineStart != line && curIndent <= startIndent && tokenStartsLine()) node.property = dummyIdent(); else - node.property = parsePropertyName() || dummyIdent(); + node.property = parsePropertyAccessor() || dummyIdent(); node.computed = false; base = finishNode(node, "MemberExpression"); } else if (token.type == tt.bracketL) { @@ -735,6 +735,10 @@ if (token.type === tt.name || token.type.keyword) return parseIdent(); } + function parsePropertyAccessor() { + if (token.type === tt.name || token.type.keyword) return parseIdent(); + } + function parseIdent() { var node = startNode(); node.name = token.type === tt.name ? token.value : token.type.keyword;