Don't crash when converting missing array elements to assignable
Closes #220
This commit is contained in:
@@ -15466,6 +15466,34 @@ test("let {x} = y", {
|
||||
"end": 11
|
||||
}, {ecmaVersion: 6})
|
||||
|
||||
test("[x,,] = 1", {
|
||||
type: "Program",
|
||||
body: [
|
||||
{
|
||||
type: "ExpressionStatement",
|
||||
expression: {
|
||||
type: "AssignmentExpression",
|
||||
operator: "=",
|
||||
left: {
|
||||
type: "ArrayPattern",
|
||||
elements: [
|
||||
{
|
||||
type: "Identifier",
|
||||
name: "x"
|
||||
},
|
||||
null
|
||||
]
|
||||
},
|
||||
right: {
|
||||
type: "Literal",
|
||||
value: 1,
|
||||
raw: "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}, {ecmaVersion: 6});
|
||||
|
||||
testFail("let [x]", "Complex binding patterns require an initialization value (1:7)", {ecmaVersion: 6})
|
||||
testFail("var [x]", "Complex binding patterns require an initialization value (1:7)", {ecmaVersion: 6})
|
||||
testFail("var _𖫵 = 11;", "Unexpected character '𖫵' (1:5)", {ecmaVersion: 6});
|
||||
|
||||
Reference in New Issue
Block a user