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.
30 lines
382 B
30 lines
382 B
/*
|
|
* https://github.com/svaarala/duktape/issues/106
|
|
*/
|
|
|
|
/*===
|
|
SyntaxError
|
|
SyntaxError
|
|
===*/
|
|
|
|
function test1() {
|
|
var src = 'function foo() [}; foo;';
|
|
print(typeof eval(src));
|
|
}
|
|
|
|
function test2() {
|
|
var src = '(function () [})';
|
|
print(typeof eval(src));
|
|
}
|
|
|
|
try {
|
|
test1();
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|
|
try {
|
|
test2();
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|