[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 1966f6a0b8 on Wed Nov 28 2018 19:04:52 GMT+0000 (Coordinated Universal Time)

This commit is contained in:
test262-automation 2018-11-28 19:07:45 +00:00
parent d52f621aba
commit 0210918f1e
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,26 @@
function assert(a, e) {
if (a !== e) {
throw new Error("Bad!");
}
}
function foo(a) {
let loc = ~a;
return a + 2;
}
noInline(foo);
let b = 0;
let o = {
valueOf: function () {
b++;
return 2;
}
};
for (let i = 0; i < 100000; i++) {
assert(foo(o), 4);
}
assert(b, 200000)

View File

@ -0,0 +1,30 @@
function assert(a, e, m) {
if (a !== e)
throw new Error("Expected to be: " + e + " but got: " + a);
}
function bitNot(a) {
return ~a;
}
noInline(bitNot);
for (let i = 0; i < 10000; i++) {
let r = bitNot("0");
assert(r, -1);
r = bitNot("1");
assert(r, -2);
r = bitNot("-1");
assert(r, 0);
r = bitNot("-2");
assert(r, 1);
r = bitNot({ valueOf: () => 0 });
assert(r, -1);
r = bitNot({ valueOf: () => 1 });
assert(r, -2);
r = bitNot({ valueOf: () => -1 });
assert(r, 0);
r = bitNot({ valueOf: () => -2 });
assert(r, 1);
}

View File

@ -0,0 +1,10 @@
function foo() {
return function () {
eval();
}
}
noInline(foo);
for (let i = 0; i < 100000; ++i) {
foo();
}