mirror of
https://github.com/tc39/test262.git
synced 2025-05-04 15:00:42 +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)
57 lines
868 B
JavaScript
57 lines
868 B
JavaScript
let assert = (a) => {
|
|
if (!a)
|
|
throw Error("Bad Assertion");
|
|
}
|
|
|
|
let aObj = {
|
|
get foo() { return this.a; }
|
|
};
|
|
|
|
let obj = {
|
|
jaz() {
|
|
return super.foo;
|
|
}
|
|
};
|
|
obj.a = "foo";
|
|
|
|
Object.setPrototypeOf(obj, aObj);
|
|
|
|
noInline(obj.jaz);
|
|
|
|
for (let i = 0; i < 10000; i++) {
|
|
if (i == 9999) {
|
|
delete aObj.foo;
|
|
assert(obj.jaz() === undefined);
|
|
} else {
|
|
assert(obj.jaz() == "foo");
|
|
}
|
|
|
|
}
|
|
|
|
let bObj = {
|
|
get foo() { return this.a; }
|
|
};
|
|
|
|
let obj2 = {
|
|
foo() {
|
|
return super.foo;
|
|
}
|
|
};
|
|
obj2.a = "foo";
|
|
|
|
Object.setPrototypeOf(obj2, bObj);
|
|
|
|
noInline(obj.jaz);
|
|
|
|
for (let i = 0; i < 10000; i++) {
|
|
if (i == 9999) {
|
|
Object.defineProperty(bObj, "foo", {
|
|
get: () => {return "boo"; }
|
|
});
|
|
assert(obj2.foo() == "boo");
|
|
} else {
|
|
assert(obj2.foo() == "foo");
|
|
}
|
|
}
|
|
|