test262/implementation-contributed/javascriptcore/stress/dont-unwind-past-vm-entry-frame.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

40 lines
719 B
JavaScript

"use strict";
// This test passes when JSC doesn't crash.
let p = new Proxy(function() { }, {
apply: function() {
return bar();
}
});
function bar() {
let item = getItem();
return item.foo;
}
let i;
let shouldReturnBad = false;
let good = [function() {return 1}, {b: 20}, {c: 40}, {d:50}]
let bad = [{asdfhasf: 20}, {e:50}, {j:70}, {k:100}, null];
function getItem() {
if (shouldReturnBad)
return bad[i % bad.length];
return good[i % good.length];
}
noInline(getItem);
function start() {
for (i = 0; i < 1000; i++) {
p();
}
shouldReturnBad = true;
for (i = 0; i < 10000; i++) {
try {
p();
} catch(e) { }
}
}
start();