Restore patch 9f7cb552648829796ab4d6836d08246e95f16b9d to original shape

And make loose parser handle stray class semicolons

Issue #190
This commit is contained in:
Marijn Haverbeke 2015-01-20 12:02:30 +01:00
parent 9f7cb55264
commit a1d2561cfa
2 changed files with 2 additions and 3 deletions

View File

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

View File

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