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.
44 lines
590 B
44 lines
590 B
/*===
|
|
62
|
|
===*/
|
|
|
|
/* This parsed incorrectly at one point, the slash was parsed as
|
|
* part of a RegExp leading to SyntaxError.
|
|
*/
|
|
|
|
var obj, val;
|
|
|
|
try {
|
|
eval("obj = { foo: 124 };");
|
|
eval("val = obj['foo']/2;");
|
|
eval("print(val)");
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
/*===
|
|
50
|
|
===*/
|
|
|
|
/* Similar test for parens */
|
|
|
|
try {
|
|
print(eval("(50+50)/2"));
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
/*===
|
|
NaN
|
|
===*/
|
|
|
|
/* Similar test for braces (this doesn't evaluate to anything useful
|
|
* but is not a SyntaxError.
|
|
*/
|
|
|
|
try {
|
|
print(eval("({foo:1}/2)"));
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
|