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.
25 lines
456 B
25 lines
456 B
/*
|
|
* Test creation and interning of new strings when the intern check
|
|
* matches an existing string in the string table. Exercises string
|
|
* hashing but limited memory churn.
|
|
*/
|
|
|
|
function test() {
|
|
var buf = Duktape.Buffer(2048);
|
|
var i;
|
|
|
|
for (i = 0; i < buf.length; i++) {
|
|
buf[i] = i;
|
|
}
|
|
|
|
for (i = 0; i < 1e6; i++) {
|
|
void String(buf);
|
|
}
|
|
}
|
|
|
|
try {
|
|
test();
|
|
} catch (e) {
|
|
print(e.stack || e);
|
|
throw e;
|
|
}
|
|
|