mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
516 B
26 lines
516 B
/*
|
|
* For-in statement (E5 Section 12.6.4).
|
|
*/
|
|
|
|
/*---
|
|
{
|
|
"knownissue": "for-in allows some invalid left-hand-side expressions which cause a runtime ReferenceError instead of a compile-time SyntaxError (e.g. 'for (a+b in [0,1]) {...}')"
|
|
}
|
|
---*/
|
|
|
|
/*===
|
|
SyntaxError
|
|
===*/
|
|
|
|
try {
|
|
/* 'a+b' is not a valid LeftHandSideExpression -> SyntaxError required */
|
|
eval("for (a+b in [0,1]) {}");
|
|
print("never here");
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
/* FIXME: other tests */
|
|
|
|
/*FIXME:break*/
|
|
/*FIXME:continue*/
|
|
|