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)
50 lines
726 B
JavaScript
50 lines
726 B
JavaScript
function assert(b) {
|
|
if (!b)
|
|
throw new Error("bad value")
|
|
}
|
|
noInline(assert);
|
|
|
|
let oThrow = {
|
|
x: 20,
|
|
y: 40,
|
|
z: 50,
|
|
get f() { throw new Error("Hello World!"); }
|
|
};
|
|
|
|
let o1 = {
|
|
x: 20,
|
|
f: 40
|
|
};
|
|
|
|
let o2 = {
|
|
x: 20,
|
|
y: 50,
|
|
get f() { return 20; }
|
|
};
|
|
|
|
function foo(f) {
|
|
let o = f();
|
|
try {
|
|
o = o.f;
|
|
} catch(e) {
|
|
assert(o === oThrow); // Make sure this is not undefined when we have an IC miss and an exception at the same time.
|
|
}
|
|
}
|
|
noInline(foo);
|
|
|
|
let i;
|
|
let flag = false;
|
|
function f() {
|
|
if (flag)
|
|
return oThrow;
|
|
if (i % 2)
|
|
return o1;
|
|
return o2;
|
|
}
|
|
noInline(f);
|
|
for (i = 0; i < 100000; i++) {
|
|
foo(f);
|
|
}
|
|
flag = true;
|
|
foo(f);
|