Restore patch 9f7cb552648829796ab4d6836d08246e95f16b9d to original shape
And make loose parser handle stray class semicolons Issue #190
This commit is contained in:
parent
9f7cb55264
commit
a1d2561cfa
3
acorn.js
3
acorn.js
@ -2524,8 +2524,7 @@
|
||||
classBody.body = [];
|
||||
expect(_braceL);
|
||||
while (!eat(_braceR)) {
|
||||
while (eat(_semi));
|
||||
if (tokType === _braceR) continue;
|
||||
if (eat(_semi)) continue;
|
||||
var method = startNode();
|
||||
var isGenerator = eat(_star);
|
||||
parsePropertyName(method);
|
||||
|
||||
@ -854,6 +854,7 @@
|
||||
eat(tt.braceL);
|
||||
if (curIndent + 1 < indent) { indent = curIndent; line = curLineStart; }
|
||||
while (!closes(tt.braceR, indent, line)) {
|
||||
if (isClass && semicolon()) continue;
|
||||
var prop = startNode(), isGenerator;
|
||||
if (options.ecmaVersion >= 6) {
|
||||
if (isClass) {
|
||||
@ -904,7 +905,6 @@
|
||||
|
||||
if (isClass) {
|
||||
node.body.body.push(finishNode(prop, "MethodDefinition"));
|
||||
semicolon();
|
||||
} else {
|
||||
node.properties.push(finishNode(prop, "Property"));
|
||||
eat(tt.comma);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user