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)
36 lines
710 B
JavaScript
36 lines
710 B
JavaScript
function foo(o) {
|
|
return o.f + 1;
|
|
}
|
|
|
|
noInline(foo);
|
|
|
|
function makeWithGetter() {
|
|
var o = {};
|
|
o.__defineGetter__("f", function() {
|
|
throw "hello";
|
|
});
|
|
return o;
|
|
}
|
|
|
|
for (var i = 0; i < 100000; ++i) {
|
|
var result = foo({f:23});
|
|
if (result != 24)
|
|
throw "Error: bad result: " + result;
|
|
result = foo({g:12, f:13});
|
|
if (result != 14)
|
|
throw "Error: bad result: " + result;
|
|
result = foo({g:12, h:13, f:14});
|
|
if (result != 15)
|
|
throw "Error: bad result: " + result;
|
|
}
|
|
|
|
var didThrow;
|
|
try {
|
|
foo(makeWithGetter());
|
|
} catch (e) {
|
|
didThrow = e;
|
|
}
|
|
|
|
if (didThrow != "hello")
|
|
throw "Error: didn't throw or threw wrong exception: " + didThrow;
|