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.
38 lines
743 B
38 lines
743 B
/*
|
|
* The compiler used to require O(2^N) passes to copmile inner functions
|
|
* (where N is function nesting level). Deeply nested functions would
|
|
* hit the compiler "token limit" and cause a RangeError to prevent the
|
|
* compiler from taking an inordinate amount of time.
|
|
*
|
|
* This has now been fixed (Duktape 0.10.0) so test that deep nesting
|
|
* works properly.
|
|
*/
|
|
|
|
/*---
|
|
{
|
|
"custom": true,
|
|
"slow": true
|
|
}
|
|
---*/
|
|
|
|
/*===
|
|
returned
|
|
===*/
|
|
|
|
function deepInnerFunctionTest() {
|
|
var txt = '';
|
|
var i;
|
|
|
|
for (i = 0; i < 1000; i++) {
|
|
txt = 'function func' + i + '() { ' + txt + ' }';
|
|
}
|
|
//print(txt);
|
|
eval(txt);
|
|
}
|
|
|
|
try {
|
|
deepInnerFunctionTest();
|
|
print('returned');
|
|
} catch (e) {
|
|
print(e.name);
|
|
}
|
|
|