Add missing labels.pop() to allow re-using labels in a block

Issue #15
This commit is contained in:
Marijn Haverbeke
2012-11-22 10:11:00 +01:00
parent 5c44c13465
commit d36c70bbbf
3 changed files with 38 additions and 0 deletions

View File

@@ -26029,6 +26029,42 @@ test("'a\\u0026b'", {
]
});
test("foo: 10; foo: 20;", {
type: "Program",
body: [
{
type: "LabeledStatement",
body: {
type: "ExpressionStatement",
expression: {
type: "Literal",
value: 10,
raw: "10"
}
},
label: {
type: "Identifier",
name: "foo"
}
},
{
type: "LabeledStatement",
body: {
type: "ExpressionStatement",
expression: {
type: "Literal",
value: 20,
raw: "20"
}
},
label: {
type: "Identifier",
name: "foo"
}
}
]
});
// Failure tests
testFail("{",