change token_error() to croak() for rest element errors
This commit is contained in:
parent
9159f0ecd4
commit
529ac31df4
|
|
@ -1522,7 +1522,7 @@ function parse($TEXT, options) {
|
||||||
}
|
}
|
||||||
if (is_expand) {
|
if (is_expand) {
|
||||||
if (!is("punc", "]")) {
|
if (!is("punc", "]")) {
|
||||||
token_error(S.token, "Rest element must be last element");
|
croak("Rest element must be last element");
|
||||||
}
|
}
|
||||||
elements[elements.length - 1] = new AST_Expansion({
|
elements[elements.length - 1] = new AST_Expansion({
|
||||||
start: expand_token,
|
start: expand_token,
|
||||||
|
|
@ -1606,7 +1606,7 @@ function parse($TEXT, options) {
|
||||||
}
|
}
|
||||||
if (is_expand) {
|
if (is_expand) {
|
||||||
if (!is("punc", "}")) {
|
if (!is("punc", "}")) {
|
||||||
token_error(S.token, "Rest element must be last element");
|
croak("Rest element must be last element");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (is("operator", "=")) {
|
else if (is("operator", "=")) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user