kopia lustrzana https://github.com/c9/core
fix infinite loop in acorn_loose when parsing broken import
rodzic
b1ede4860e
commit
b551071cdc
|
@ -1146,6 +1146,7 @@ lp.parseImportSpecifierList = function () {
|
||||||
this.pushCx();
|
this.pushCx();
|
||||||
this.eat(tt.braceL);
|
this.eat(tt.braceL);
|
||||||
if (this.curLineStart > continuedLine) continuedLine = this.curLineStart;
|
if (this.curLineStart > continuedLine) continuedLine = this.curLineStart;
|
||||||
|
var lastTokenStart = -1;
|
||||||
while (!this.closes(tt.braceR, indent + (this.curLineStart <= continuedLine ? 1 : 0), line)) {
|
while (!this.closes(tt.braceR, indent + (this.curLineStart <= continuedLine ? 1 : 0), line)) {
|
||||||
var elt = this.startNode();
|
var elt = this.startNode();
|
||||||
if (this.eat(tt.star)) {
|
if (this.eat(tt.star)) {
|
||||||
|
@ -1157,6 +1158,8 @@ lp.parseImportSpecifierList = function () {
|
||||||
elt.local = this.eatContextual("as") ? this.parseIdent() : elt.imported;
|
elt.local = this.eatContextual("as") ? this.parseIdent() : elt.imported;
|
||||||
this.finishNode(elt, "ImportSpecifier");
|
this.finishNode(elt, "ImportSpecifier");
|
||||||
}
|
}
|
||||||
|
if (elt.start == lastTokenStart) break;
|
||||||
|
lastTokenStart = elt.start;
|
||||||
elts.push(elt);
|
elts.push(elt);
|
||||||
this.eat(tt.comma);
|
this.eat(tt.comma);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue