mirror of https://github.com/tc39/test262.git
[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 38e0e5eed1 on Wed Nov 14 2018 18:57:07 GMT+0000 (Coordinated Universal Time)
This commit is contained in:
parent
238c88d4a0
commit
89489cb6f5
|
@ -1,63 +0,0 @@
|
||||||
//@ 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,0 +1,22 @@
|
||||||
|
//@ skip if $memoryLimited
|
||||||
|
|
||||||
|
function foo(str, count) {
|
||||||
|
while (str.length < count) {
|
||||||
|
try {
|
||||||
|
str += str;
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
return str.substring();
|
||||||
|
}
|
||||||
|
var x = foo("1", 1 << 20);
|
||||||
|
var y = foo("$1", 1 << 16);
|
||||||
|
|
||||||
|
var exception;
|
||||||
|
try {
|
||||||
|
var __v_6623 = x.replace(/(.+)/g, y);
|
||||||
|
} catch (e) {
|
||||||
|
exception = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exception != "Error: Out of memory")
|
||||||
|
throw "FAILED";
|
|
@ -0,0 +1,26 @@
|
||||||
|
//@ requireOptions("--maxPerThreadStackUsage=400000", "--useTypeProfiler=true", "--exceptionStackTraceLimit=1", "--defaultErrorStackTraceLimit=1")
|
||||||
|
|
||||||
|
// This test passes if it does not crash.
|
||||||
|
|
||||||
|
var count = 0;
|
||||||
|
|
||||||
|
function bar() {
|
||||||
|
new foo();
|
||||||
|
};
|
||||||
|
|
||||||
|
function foo() {
|
||||||
|
if (count++ > 2000)
|
||||||
|
return;
|
||||||
|
let proxy = new Proxy({}, {
|
||||||
|
set: function() {
|
||||||
|
bar();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
Reflect.set(proxy);
|
||||||
|
foo();
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bar();
|
|
@ -0,0 +1,26 @@
|
||||||
|
//@ runDefault("--thresholdForOptimizeAfterWarmUp=0", "--useTypeProfiler=true")
|
||||||
|
|
||||||
|
function foo() {
|
||||||
|
try {
|
||||||
|
throw 42;
|
||||||
|
} catch(e) {
|
||||||
|
if (e !== 42)
|
||||||
|
throw new Error("Bad!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function test(_a) {
|
||||||
|
if (_a === 0) {
|
||||||
|
foo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function bar() {
|
||||||
|
test(Intl.NumberFormat());
|
||||||
|
test(Intl.NumberFormat());
|
||||||
|
test(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i=0; i<200; i++) {
|
||||||
|
bar()
|
||||||
|
}
|
Loading…
Reference in New Issue