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.
34 lines
434 B
34 lines
434 B
11 years ago
|
/*
|
||
|
* Test limits on inner functions.
|
||
|
*/
|
||
|
|
||
|
/*===
|
||
|
test 1 ok
|
||
|
test 2 ok
|
||
|
test 3 ok
|
||
|
===*/
|
||
|
|
||
|
function test(n) {
|
||
|
var src = '';
|
||
|
|
||
|
src += '(function () {';
|
||
|
for (i = 0; i < n; i++) {
|
||
|
src += 'function innerfunc' + i + '() {} ';
|
||
|
}
|
||
|
src += '})';
|
||
|
|
||
|
eval(src);
|
||
|
}
|
||
|
|
||
|
try {
|
||
|
test(100);
|
||
|
print('test 1 ok');
|
||
|
test(200);
|
||
|
print('test 2 ok');
|
||
|
test(10000);
|
||
|
print('test 3 ok');
|
||
|
} catch (e) {
|
||
|
print(e);
|
||
|
}
|
||
|
|