Skip to content
Snippets Groups Projects
Commit 23dc1e1d authored by test262-automation's avatar test262-automation Committed by Rick Waldron
Browse files

[javascriptcore-test262-automation] Changes from...

[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha b85a66fba6 on Tue Nov 13 2018 18:55:51 GMT+0000 (Coordinated Universal Time)
parent 5da519e2
No related branches found
No related tags found
No related merge requests found
//@ runDefault("--useBigInt=true", "--useDFGJIT=false")
function assert(a, message) {
if (!a)
throw new Error(message);
}
function lshift(y) {
let out = 1n;
for (let i = 0; i < y; i++) {
out *= 2n;
}
return out;
}
let a = lshift(16384 * 63);
for (let i = 0; i < 256; i++) {
a *= 18446744073709551615n;
}
try {
let b = a + 1n;
assert(false, "Should throw OutOfMemoryError, but executed without exception");
} catch(e) {
assert(e.message == "Out of memory", "Expected OutOfMemoryError, but got: " + e);
}
try {
let b = a - (-1n);
assert(false, "Should throw OutOfMemoryError, but executed without exception");
} catch(e) {
assert(e.message == "Out of memory", "Expected OutOfMemoryError, but got: " + e);
}
try {
let b = a * (-1n);
assert(false, "Should throw OutOfMemoryError, but executed without exception");
} catch(e) {
assert(e.message == "Out of memory", "Expected OutOfMemoryError, but got: " + e);
}
try {
let b = a / a;
assert(false, "Should throw OutOfMemoryError, but executed without exception");
} catch(e) {
assert(e.message == "Out of memory", "Expected OutOfMemoryError, but got: " + e);
}
try {
let b = -a & -1n;
assert(false, "Should throw OutOfMemoryError, but executed without exception");
} catch(e) {
assert(e.message == "Out of memory", "Expected OutOfMemoryError, but got: " + e);
}
try {
let b = a ^ -1n;
assert(false, "Should throw OutOfMemoryError, but executed without exception");
} catch(e) {
assert(e.message == "Out of memory", "Expected OutOfMemoryError, but got: " + e);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment