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.
 
 
 
 
 
 

35 lines
680 B

if (typeof print !== 'function') { print = console.log; }
function build() {
var obj = {};
var ab = new ArrayBuffer(32);
var vw = new Uint32Array(ab, 4, 3);
var i;
for (i = 0; i < ab.length; i++) {
ab[i] = i;
}
return {
foo: [ ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab ],
bar: [ vw, vw, vw, vw, vw, vw, vw, vw, vw, vw, vw, vw, vw, vw, vw, vw ]
};
}
function test() {
var obj;
var i;
var ignore;
obj = build();
for (i = 0; i < 3e5; i++) {
ignore = Duktape.enc('jx', obj);
}
//print(ignore);
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}