test262/implementation-contributed/javascriptcore/stress/spread-escapes-but-new-array-buffer-does-not-double.js
test262-automation e9a5a7f918 [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time) (#1620)
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
2018-07-03 15:59:58 -04:00

36 lines
687 B
JavaScript

function assert(b) {
if (!b)
throw new Error;
}
noInline(assert);
function getProperties(obj) {
let properties = [];
for (let name of Object.getOwnPropertyNames(obj)) {
properties.push(name);
}
return properties;
}
function theFunc(obj, index) {
let args = [42.195, 20.2];
let functions = getProperties(obj);
let func = functions[index % functions.length];
obj[func](...args);
}
let obj = {
valueOf: function (x, y) {
assert(x === 42.195);
assert(y === 20.2);
try {
} catch (e) {}
}
};
for (let i = 0; i < 1e5; ++i) {
for (let _i = 0; _i < 100; _i++) {
}
theFunc(obj, 897989);
}