mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 22:40:28 +02:00
* [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)
31 lines
651 B
JavaScript
31 lines
651 B
JavaScript
let objs = new Array(1000);
|
|
for (let i of objs.keys()) {
|
|
let o = {};
|
|
// Make the object an uncacheable dictionary.
|
|
o.foo = 1;
|
|
delete o.foo;
|
|
objs[i] = o;
|
|
}
|
|
|
|
function f(o) {
|
|
o.foo = 42;
|
|
}
|
|
|
|
for (let obj of objs) {
|
|
let setter = new Function(`
|
|
Object.defineProperty(this, "foo", {
|
|
writable: true,
|
|
configurable: true,
|
|
value: null
|
|
});
|
|
let o = Object.create(this);
|
|
// Need eval to get a new IC to flatten obj.
|
|
let str = "for (let i = 0; i < 1000; i++) o.foo";
|
|
eval(str);
|
|
`);
|
|
|
|
obj.__defineSetter__("foo", setter);
|
|
f(obj);
|
|
f(obj);
|
|
}
|