Merge pull request #1979 from test262-automation/javascriptcore-test262-automation-export-0210918f1e

Import test changes from JavaScriptCore
This commit is contained in:
Leo Balter 2018-12-03 17:28:14 -05:00 committed by GitHub
commit 1eff0cf52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"sourceRevisionAtLastExport": "e7f9d46220",
"targetRevisionAtLastExport": "0210918f1e",
"sourceRevisionAtLastExport": "60ed1be8cd",
"targetRevisionAtLastExport": "31e654a339",
"curatedFiles": {
"/stress/Number-isNaN-basics.js": "DELETED_IN_TARGET",
"/stress/Object_static_methods_Object.getOwnPropertyDescriptors-proxy.js": "DELETED_IN_TARGET",

View File

@ -0,0 +1,25 @@
//@ runBigIntEnabled
let assert = {
sameValue: function(i, e) {
if (i !== e)
throw new Error(m);
}
}
function bigIntBitXor(a, b) {
return (a ^ b) ^ (a ^ 0b11n);
}
noInline(bigIntBitXor);
for (let i = 0; i < 10000; i++) {
let r = bigIntBitXor(0b11n, 0b1010n);
assert.sameValue(r, 0b1001n);
}
for (let i = 0; i < 10000; i++) {
let r = bigIntBitXor(0xfffafafaf19281fefafeafebcn, 0b1010n);
assert.sameValue(r, 0b1001n);
}

View File

@ -0,0 +1,14 @@
//@ runBigIntEnabled
function assert(a) {
if (!a)
throw new Error("Bad assertion");
}
let a = 0b11n;
for (let i = 0; i < 1000000; i++) {
a ^= 0b01n;
}
assert(a === 0b11n);

View File

@ -0,0 +1,26 @@
//@ runBigIntEnabled
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntOperations(a, b) {
let c = a ^ b;
return a ^ c;
}
noInline(bigIntOperations);
c = 0;
let o = { valueOf: function () {
c++;
return 0b1111n;
}};
for (let i = 0; i < 100000; i++) {
let out = bigIntOperations(o, 0b1010n);
assert(out, 0b1010n);
}
assert(c, 200000);