mirror of https://github.com/svaarala/duktape.git
Sami Vaarala
8 years ago
3 changed files with 41 additions and 46 deletions
@ -1,51 +1,46 @@ |
|||||
/*=== |
/*=== |
||||
300 |
250 |
||||
ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ |
ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJ |
||||
|
RangeError |
||||
===*/ |
===*/ |
||||
|
|
||||
/* This currently fails due to Duktape register count limits; the failure is |
function test(count) { |
||||
* not specific to String.fromCharCode(). However, String.fromCharCode() is |
var src = []; |
||||
* an example of a function which could conceivably be used with a lot of |
var i; |
||||
* arguments, to build a large Unicode string. |
src.push('String.fromCharCode('); |
||||
*/ |
for (i = 0; i < count; i++) { |
||||
|
if (i > 0) { |
||||
|
src.push(','); |
||||
|
} |
||||
|
src.push(String(65 + (i % 10))); |
||||
|
} |
||||
|
src.push(')'); |
||||
|
return eval(src.join('')); |
||||
|
} |
||||
|
|
||||
try { |
try { |
||||
var t; |
var t; |
||||
|
|
||||
t = String.fromCharCode( |
try { |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
t = test(250); |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
print(t.length); |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
print(t); |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
} catch (e) { |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
print(e.name); |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
} |
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74); // 300 args
|
|
||||
|
|
||||
print(t.length); |
/* This currently fails due to Duktape register count limits; the failure is |
||||
print(t); |
* not specific to String.fromCharCode(). However, String.fromCharCode() is |
||||
|
* an example of a function which could conceivably be used with a lot of |
||||
|
* arguments, to build a large Unicode string. |
||||
|
*/ |
||||
|
try { |
||||
|
t = test(300); |
||||
|
print(t.length); |
||||
|
print(t); |
||||
|
} catch (e) { |
||||
|
print(e.name); |
||||
|
} |
||||
} catch (e) { |
} catch (e) { |
||||
print(e); |
print(e.stack || e); |
||||
} |
} |
||||
|
Loading…
Reference in new issue