mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Fix blunder in reworking of how SpiderMonkey detects a label statement (reported by Steve Yegge).
This commit is contained in:
parent
619436ff32
commit
eca0bc73e1
@ -547,18 +547,23 @@ function Statement(t, x) {
|
||||
return n;
|
||||
|
||||
default:
|
||||
if (tt == IDENTIFIER && t.peek() == COLON) {
|
||||
label = t.token.value;
|
||||
ss = x.stmtStack;
|
||||
for (i = ss.length-1; i >= 0; --i) {
|
||||
if (ss[i].label == label)
|
||||
throw t.newSyntaxError("Duplicate label");
|
||||
if (tt == IDENTIFIER) {
|
||||
t.scanOperand = false;
|
||||
tt = t.peek();
|
||||
t.scanOperand = true;
|
||||
if (tt == COLON) {
|
||||
label = t.token.value;
|
||||
ss = x.stmtStack;
|
||||
for (i = ss.length-1; i >= 0; --i) {
|
||||
if (ss[i].label == label)
|
||||
throw t.newSyntaxError("Duplicate label");
|
||||
}
|
||||
t.get();
|
||||
n = new Node(t, LABEL);
|
||||
n.label = label;
|
||||
n.statement = nest(t, x, n, Statement);
|
||||
return n;
|
||||
}
|
||||
t.get();
|
||||
n = new Node(t, LABEL);
|
||||
n.label = label;
|
||||
n.statement = nest(t, x, n, Statement);
|
||||
return n;
|
||||
}
|
||||
|
||||
n = new Node(t, SEMICOLON);
|
||||
|
Loading…
Reference in New Issue
Block a user