summaryrefslogtreecommitdiff
path: root/Libraries/LibJS
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r--Libraries/LibJS/Tests/Array.js2
-rw-r--r--Libraries/LibJS/Tests/Array.prototype.pop.js2
-rw-r--r--Libraries/LibJS/Tests/Array.prototype.shift.js2
-rw-r--r--Libraries/LibJS/Tests/Date.now.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getDate.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getDay.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getFullYear.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getHours.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getMilliseconds.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getMinutes.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getMonth.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getSeconds.js2
-rw-r--r--Libraries/LibJS/Tests/Date.prototype.getTime.js2
-rw-r--r--Libraries/LibJS/Tests/Error.js2
-rw-r--r--Libraries/LibJS/Tests/Error.prototype.toString.js2
-rw-r--r--Libraries/LibJS/Tests/Function.js2
-rw-r--r--Libraries/LibJS/Tests/Function.prototype.apply.js2
-rw-r--r--Libraries/LibJS/Tests/Function.prototype.call.js2
-rw-r--r--Libraries/LibJS/Tests/Function.prototype.toString.js2
-rw-r--r--Libraries/LibJS/Tests/Infinity-basic.js2
-rw-r--r--Libraries/LibJS/Tests/Math-constants.js2
-rw-r--r--Libraries/LibJS/Tests/Math.abs.js2
-rw-r--r--Libraries/LibJS/Tests/Math.ceil.js2
-rw-r--r--Libraries/LibJS/Tests/Math.max.js2
-rw-r--r--Libraries/LibJS/Tests/Math.sqrt.js2
-rw-r--r--Libraries/LibJS/Tests/Math.trunc.js2
-rw-r--r--Libraries/LibJS/Tests/NaN-basic.js2
-rw-r--r--Libraries/LibJS/Tests/Object.getOwnPropertyNames.js2
-rw-r--r--Libraries/LibJS/Tests/Object.getPrototypeOf.js2
-rw-r--r--Libraries/LibJS/Tests/Object.prototype.hasOwnProperty.js2
-rw-r--r--Libraries/LibJS/Tests/Object.prototype.js2
-rw-r--r--Libraries/LibJS/Tests/Object.prototype.toString.js2
-rw-r--r--Libraries/LibJS/Tests/String.prototype.charAt.js2
-rw-r--r--Libraries/LibJS/Tests/String.prototype.indexOf.js2
-rw-r--r--Libraries/LibJS/Tests/String.prototype.startsWith.js2
-rw-r--r--Libraries/LibJS/Tests/array-basic.js2
-rw-r--r--Libraries/LibJS/Tests/arrow-functions.js1
-rw-r--r--Libraries/LibJS/Tests/binary-bitwise-operators-basic.js2
-rw-r--r--Libraries/LibJS/Tests/continue-basic.js2
-rw-r--r--Libraries/LibJS/Tests/do-while-basic.js2
-rw-r--r--Libraries/LibJS/Tests/exception-ReferenceError.js2
-rw-r--r--Libraries/LibJS/Tests/for-basic.js2
-rw-r--r--Libraries/LibJS/Tests/for-no-curlies.js2
-rw-r--r--Libraries/LibJS/Tests/function-TypeError.js2
-rw-r--r--Libraries/LibJS/Tests/function-length.js2
-rw-r--r--Libraries/LibJS/Tests/function-missing-arg.js2
-rw-r--r--Libraries/LibJS/Tests/function-this-in-arguments.js2
-rw-r--r--Libraries/LibJS/Tests/instanceof-basic.js2
-rw-r--r--Libraries/LibJS/Tests/logical-expressions-basic.js2
-rw-r--r--Libraries/LibJS/Tests/logical-expressions-short-circuit.js2
-rw-r--r--Libraries/LibJS/Tests/modulo-basic.js2
-rw-r--r--Libraries/LibJS/Tests/parser-unary-associativity.js2
-rwxr-xr-xLibraries/LibJS/Tests/run-tests2
-rw-r--r--Libraries/LibJS/Tests/switch-break.js2
-rw-r--r--Libraries/LibJS/Tests/ternary-basic.js4
-rw-r--r--Libraries/LibJS/Tests/throw-basic.js2
-rw-r--r--Libraries/LibJS/Tests/to-number-basic.js2
-rw-r--r--Libraries/LibJS/Tests/typeof-basic.js2
-rw-r--r--Libraries/LibJS/Tests/var-multiple-declarator.js2
-rw-r--r--Libraries/LibJS/Tests/variable-undefined.js2
60 files changed, 2 insertions, 119 deletions
diff --git a/Libraries/LibJS/Tests/Array.js b/Libraries/LibJS/Tests/Array.js
index 87cd168e35..519bb54d8b 100644
--- a/Libraries/LibJS/Tests/Array.js
+++ b/Libraries/LibJS/Tests/Array.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Array.length === 1);
assert(Array.prototype.length === 0);
diff --git a/Libraries/LibJS/Tests/Array.prototype.pop.js b/Libraries/LibJS/Tests/Array.prototype.pop.js
index 4cb895f5ab..c6ce64554b 100644
--- a/Libraries/LibJS/Tests/Array.prototype.pop.js
+++ b/Libraries/LibJS/Tests/Array.prototype.pop.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var a = [1, 2, 3];
var value = a.pop();
diff --git a/Libraries/LibJS/Tests/Array.prototype.shift.js b/Libraries/LibJS/Tests/Array.prototype.shift.js
index 1494556299..97f748744b 100644
--- a/Libraries/LibJS/Tests/Array.prototype.shift.js
+++ b/Libraries/LibJS/Tests/Array.prototype.shift.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var a = [1, 2, 3];
var value = a.shift();
diff --git a/Libraries/LibJS/Tests/Date.now.js b/Libraries/LibJS/Tests/Date.now.js
index 53eb00d6bb..5459242cd4 100644
--- a/Libraries/LibJS/Tests/Date.now.js
+++ b/Libraries/LibJS/Tests/Date.now.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var last = 0;
for (var i = 0; i < 100; ++i) {
diff --git a/Libraries/LibJS/Tests/Date.prototype.getDate.js b/Libraries/LibJS/Tests/Date.prototype.getDate.js
index d8a9df88a3..e70dc7623c 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getDate.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getDate.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getDate()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getDay.js b/Libraries/LibJS/Tests/Date.prototype.getDay.js
index 572dd57b73..631f386ae3 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getDay.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getDay.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getDay()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getFullYear.js b/Libraries/LibJS/Tests/Date.prototype.getFullYear.js
index 1f5b9a443d..6a102f2395 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getFullYear.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getFullYear.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getFullYear()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getHours.js b/Libraries/LibJS/Tests/Date.prototype.getHours.js
index 799e1e2247..b09e000a6e 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getHours.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getHours.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getHours()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getMilliseconds.js b/Libraries/LibJS/Tests/Date.prototype.getMilliseconds.js
index 04f7e82b40..95f9d19916 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getMilliseconds.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getMilliseconds.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getMilliseconds()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getMinutes.js b/Libraries/LibJS/Tests/Date.prototype.getMinutes.js
index 13910bbd99..bf09c0278e 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getMinutes.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getMinutes.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getMinutes()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getMonth.js b/Libraries/LibJS/Tests/Date.prototype.getMonth.js
index 4ece401aca..a6503b9b32 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getMonth.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getMonth.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getMonth()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getSeconds.js b/Libraries/LibJS/Tests/Date.prototype.getSeconds.js
index b3cd352473..e96272f9d6 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getSeconds.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getSeconds.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getSeconds()));
diff --git a/Libraries/LibJS/Tests/Date.prototype.getTime.js b/Libraries/LibJS/Tests/Date.prototype.getTime.js
index 4f1da2db8d..a7a54ee3fc 100644
--- a/Libraries/LibJS/Tests/Date.prototype.getTime.js
+++ b/Libraries/LibJS/Tests/Date.prototype.getTime.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var d = new Date();
assert(!isNaN(d.getTime()));
diff --git a/Libraries/LibJS/Tests/Error.js b/Libraries/LibJS/Tests/Error.js
index 713fc4e884..ddf78f28a9 100644
--- a/Libraries/LibJS/Tests/Error.js
+++ b/Libraries/LibJS/Tests/Error.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var e;
diff --git a/Libraries/LibJS/Tests/Error.prototype.toString.js b/Libraries/LibJS/Tests/Error.prototype.toString.js
index cc0b8185c0..88a785fc23 100644
--- a/Libraries/LibJS/Tests/Error.prototype.toString.js
+++ b/Libraries/LibJS/Tests/Error.prototype.toString.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Error().toString() === "Error");
assert(Error(undefined).toString() === "Error");
diff --git a/Libraries/LibJS/Tests/Function.js b/Libraries/LibJS/Tests/Function.js
index 5618aa5219..1f4b232b6b 100644
--- a/Libraries/LibJS/Tests/Function.js
+++ b/Libraries/LibJS/Tests/Function.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Function.length === 1);
assert(Function.prototype.length === 0);
diff --git a/Libraries/LibJS/Tests/Function.prototype.apply.js b/Libraries/LibJS/Tests/Function.prototype.apply.js
index 22d14194ff..04f2fbd71b 100644
--- a/Libraries/LibJS/Tests/Function.prototype.apply.js
+++ b/Libraries/LibJS/Tests/Function.prototype.apply.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
function Foo(arg) {
this.foo = arg;
diff --git a/Libraries/LibJS/Tests/Function.prototype.call.js b/Libraries/LibJS/Tests/Function.prototype.call.js
index da24707511..30e7725896 100644
--- a/Libraries/LibJS/Tests/Function.prototype.call.js
+++ b/Libraries/LibJS/Tests/Function.prototype.call.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
function Foo(arg) {
this.foo = arg;
diff --git a/Libraries/LibJS/Tests/Function.prototype.toString.js b/Libraries/LibJS/Tests/Function.prototype.toString.js
index a1fd3c7252..0d52bc7940 100644
--- a/Libraries/LibJS/Tests/Function.prototype.toString.js
+++ b/Libraries/LibJS/Tests/Function.prototype.toString.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert((function() {}).toString() === "function () {\n ???\n}");
assert((function(foo) {}).toString() === "function (foo) {\n ???\n}");
diff --git a/Libraries/LibJS/Tests/Infinity-basic.js b/Libraries/LibJS/Tests/Infinity-basic.js
index c86ff0114d..33164410f4 100644
--- a/Libraries/LibJS/Tests/Infinity-basic.js
+++ b/Libraries/LibJS/Tests/Infinity-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Infinity + "" === "Infinity");
assert(-Infinity + "" === "-Infinity");
diff --git a/Libraries/LibJS/Tests/Math-constants.js b/Libraries/LibJS/Tests/Math-constants.js
index aeb224920f..35940775cb 100644
--- a/Libraries/LibJS/Tests/Math-constants.js
+++ b/Libraries/LibJS/Tests/Math-constants.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
// FIXME: The parser seems to have issues with decimals,
// so we multiply everything and compare with whole numbers.
// I.e. 1233 < X * 1000 < 1235 instead of 1.233 < X < 1.235
diff --git a/Libraries/LibJS/Tests/Math.abs.js b/Libraries/LibJS/Tests/Math.abs.js
index 5224f168cb..0c2ed1e0ab 100644
--- a/Libraries/LibJS/Tests/Math.abs.js
+++ b/Libraries/LibJS/Tests/Math.abs.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Math.abs('-1') === 1);
assert(Math.abs(-2) === 2);
diff --git a/Libraries/LibJS/Tests/Math.ceil.js b/Libraries/LibJS/Tests/Math.ceil.js
index a8507c5eb6..9ed8ff8960 100644
--- a/Libraries/LibJS/Tests/Math.ceil.js
+++ b/Libraries/LibJS/Tests/Math.ceil.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Math.ceil(0.95) === 1);
assert(Math.ceil(4) === 4);
diff --git a/Libraries/LibJS/Tests/Math.max.js b/Libraries/LibJS/Tests/Math.max.js
index dc4e8569eb..1f27e1775c 100644
--- a/Libraries/LibJS/Tests/Math.max.js
+++ b/Libraries/LibJS/Tests/Math.max.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Math.max.length === 2);
assert(Math.max(1) === 1);
diff --git a/Libraries/LibJS/Tests/Math.sqrt.js b/Libraries/LibJS/Tests/Math.sqrt.js
index c8574d71cf..07a57e6507 100644
--- a/Libraries/LibJS/Tests/Math.sqrt.js
+++ b/Libraries/LibJS/Tests/Math.sqrt.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Math.sqrt(9) === 3);
console.log("PASS");
diff --git a/Libraries/LibJS/Tests/Math.trunc.js b/Libraries/LibJS/Tests/Math.trunc.js
index 29a9f1ad2a..ec2bf0c537 100644
--- a/Libraries/LibJS/Tests/Math.trunc.js
+++ b/Libraries/LibJS/Tests/Math.trunc.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(Math.trunc(13.37) === 13);
assert(Math.trunc(42.84) === 42);
diff --git a/Libraries/LibJS/Tests/NaN-basic.js b/Libraries/LibJS/Tests/NaN-basic.js
index b0f2956c72..b9a02bc425 100644
--- a/Libraries/LibJS/Tests/NaN-basic.js
+++ b/Libraries/LibJS/Tests/NaN-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var nan = undefined + 1;
assert(nan + "" == "NaN");
diff --git a/Libraries/LibJS/Tests/Object.getOwnPropertyNames.js b/Libraries/LibJS/Tests/Object.getOwnPropertyNames.js
index a9673c03cf..990dbf2801 100644
--- a/Libraries/LibJS/Tests/Object.getOwnPropertyNames.js
+++ b/Libraries/LibJS/Tests/Object.getOwnPropertyNames.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var names = Object.getOwnPropertyNames([1, 2, 3]);
diff --git a/Libraries/LibJS/Tests/Object.getPrototypeOf.js b/Libraries/LibJS/Tests/Object.getPrototypeOf.js
index 6b48fc28b8..08ccc6a0da 100644
--- a/Libraries/LibJS/Tests/Object.getPrototypeOf.js
+++ b/Libraries/LibJS/Tests/Object.getPrototypeOf.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var o1 = new Object();
var o2 = {};
diff --git a/Libraries/LibJS/Tests/Object.prototype.hasOwnProperty.js b/Libraries/LibJS/Tests/Object.prototype.hasOwnProperty.js
index 9a47401bf5..225394939f 100644
--- a/Libraries/LibJS/Tests/Object.prototype.hasOwnProperty.js
+++ b/Libraries/LibJS/Tests/Object.prototype.hasOwnProperty.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var o = {};
o.foo = 1;
diff --git a/Libraries/LibJS/Tests/Object.prototype.js b/Libraries/LibJS/Tests/Object.prototype.js
index 237de47a98..0d794442d5 100644
--- a/Libraries/LibJS/Tests/Object.prototype.js
+++ b/Libraries/LibJS/Tests/Object.prototype.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var o = new Object();
Object.prototype.foo = 123;
diff --git a/Libraries/LibJS/Tests/Object.prototype.toString.js b/Libraries/LibJS/Tests/Object.prototype.toString.js
index a56a377870..2672b70f1b 100644
--- a/Libraries/LibJS/Tests/Object.prototype.toString.js
+++ b/Libraries/LibJS/Tests/Object.prototype.toString.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(typeof Object.prototype.toString() === "string");
console.log("PASS");
diff --git a/Libraries/LibJS/Tests/String.prototype.charAt.js b/Libraries/LibJS/Tests/String.prototype.charAt.js
index 741e89e2ec..994fed659d 100644
--- a/Libraries/LibJS/Tests/String.prototype.charAt.js
+++ b/Libraries/LibJS/Tests/String.prototype.charAt.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var s = "foobar"
assert(typeof s === "string");
diff --git a/Libraries/LibJS/Tests/String.prototype.indexOf.js b/Libraries/LibJS/Tests/String.prototype.indexOf.js
index 3c84a4ece8..117093b61e 100644
--- a/Libraries/LibJS/Tests/String.prototype.indexOf.js
+++ b/Libraries/LibJS/Tests/String.prototype.indexOf.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var s = "hello friends"
diff --git a/Libraries/LibJS/Tests/String.prototype.startsWith.js b/Libraries/LibJS/Tests/String.prototype.startsWith.js
index 38ac98d4a2..fe7c511681 100644
--- a/Libraries/LibJS/Tests/String.prototype.startsWith.js
+++ b/Libraries/LibJS/Tests/String.prototype.startsWith.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var s = "foobar";
assert(s.startsWith("f") === true);
diff --git a/Libraries/LibJS/Tests/array-basic.js b/Libraries/LibJS/Tests/array-basic.js
index cc06f8925a..7298fab672 100644
--- a/Libraries/LibJS/Tests/array-basic.js
+++ b/Libraries/LibJS/Tests/array-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var a = [1, 2, 3];
diff --git a/Libraries/LibJS/Tests/arrow-functions.js b/Libraries/LibJS/Tests/arrow-functions.js
index 3d2569d099..5d4f118a7c 100644
--- a/Libraries/LibJS/Tests/arrow-functions.js
+++ b/Libraries/LibJS/Tests/arrow-functions.js
@@ -1,4 +1,3 @@
-function assert(x) { if (!x) throw 1; }
try {
let getNumber = () => 42;
assert(getNumber() === 42);
diff --git a/Libraries/LibJS/Tests/binary-bitwise-operators-basic.js b/Libraries/LibJS/Tests/binary-bitwise-operators-basic.js
index 81a772d9e6..704a00349e 100644
--- a/Libraries/LibJS/Tests/binary-bitwise-operators-basic.js
+++ b/Libraries/LibJS/Tests/binary-bitwise-operators-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert((0 | 0) === 0);
assert((0 | 1) === 1);
diff --git a/Libraries/LibJS/Tests/continue-basic.js b/Libraries/LibJS/Tests/continue-basic.js
index eda0648f08..a0d59cdeb6 100644
--- a/Libraries/LibJS/Tests/continue-basic.js
+++ b/Libraries/LibJS/Tests/continue-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var j = 0;
for (var i = 0; i < 9; ++i) {
diff --git a/Libraries/LibJS/Tests/do-while-basic.js b/Libraries/LibJS/Tests/do-while-basic.js
index f0ca39136f..5ca6d50791 100644
--- a/Libraries/LibJS/Tests/do-while-basic.js
+++ b/Libraries/LibJS/Tests/do-while-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var number = 0;
do {
diff --git a/Libraries/LibJS/Tests/exception-ReferenceError.js b/Libraries/LibJS/Tests/exception-ReferenceError.js
index 2fe47e25a9..b26804a316 100644
--- a/Libraries/LibJS/Tests/exception-ReferenceError.js
+++ b/Libraries/LibJS/Tests/exception-ReferenceError.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) console.log("FAIL"); }
-
try {
i < 3;
} catch (e) {
diff --git a/Libraries/LibJS/Tests/for-basic.js b/Libraries/LibJS/Tests/for-basic.js
index b7fcb5b1e6..c68c2b9972 100644
--- a/Libraries/LibJS/Tests/for-basic.js
+++ b/Libraries/LibJS/Tests/for-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var a = [];
for (var i = 0; i < 3; ++i) {
diff --git a/Libraries/LibJS/Tests/for-no-curlies.js b/Libraries/LibJS/Tests/for-no-curlies.js
index 817aea2fbb..8c54819a2d 100644
--- a/Libraries/LibJS/Tests/for-no-curlies.js
+++ b/Libraries/LibJS/Tests/for-no-curlies.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var number = 0;
diff --git a/Libraries/LibJS/Tests/function-TypeError.js b/Libraries/LibJS/Tests/function-TypeError.js
index 204fc7e495..1939e01f06 100644
--- a/Libraries/LibJS/Tests/function-TypeError.js
+++ b/Libraries/LibJS/Tests/function-TypeError.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
try {
var b = true;
diff --git a/Libraries/LibJS/Tests/function-length.js b/Libraries/LibJS/Tests/function-length.js
index e24f08e490..7a3e69cc32 100644
--- a/Libraries/LibJS/Tests/function-length.js
+++ b/Libraries/LibJS/Tests/function-length.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
function foo() { }
assert(foo.length === 0);
diff --git a/Libraries/LibJS/Tests/function-missing-arg.js b/Libraries/LibJS/Tests/function-missing-arg.js
index 8bef98e4f6..48810a38e7 100644
--- a/Libraries/LibJS/Tests/function-missing-arg.js
+++ b/Libraries/LibJS/Tests/function-missing-arg.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
function foo(a, b) { return a + b; }
try {
diff --git a/Libraries/LibJS/Tests/function-this-in-arguments.js b/Libraries/LibJS/Tests/function-this-in-arguments.js
index 23bf80937c..efa8d6bfea 100644
--- a/Libraries/LibJS/Tests/function-this-in-arguments.js
+++ b/Libraries/LibJS/Tests/function-this-in-arguments.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(typeof this === "object");
assert(this === global);
diff --git a/Libraries/LibJS/Tests/instanceof-basic.js b/Libraries/LibJS/Tests/instanceof-basic.js
index 5fa9805aa6..0db8dbdc0a 100644
--- a/Libraries/LibJS/Tests/instanceof-basic.js
+++ b/Libraries/LibJS/Tests/instanceof-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
function Foo() {
this.x = 123;
diff --git a/Libraries/LibJS/Tests/logical-expressions-basic.js b/Libraries/LibJS/Tests/logical-expressions-basic.js
index 58d05e1111..de7ff65fd7 100644
--- a/Libraries/LibJS/Tests/logical-expressions-basic.js
+++ b/Libraries/LibJS/Tests/logical-expressions-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert((true && true) === true);
assert((false && false) === false);
diff --git a/Libraries/LibJS/Tests/logical-expressions-short-circuit.js b/Libraries/LibJS/Tests/logical-expressions-short-circuit.js
index 105281f62f..a666255ac7 100644
--- a/Libraries/LibJS/Tests/logical-expressions-short-circuit.js
+++ b/Libraries/LibJS/Tests/logical-expressions-short-circuit.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
let foo = 1;
false && (foo = 2);
diff --git a/Libraries/LibJS/Tests/modulo-basic.js b/Libraries/LibJS/Tests/modulo-basic.js
index 7d0e894405..4f35c2b3ea 100644
--- a/Libraries/LibJS/Tests/modulo-basic.js
+++ b/Libraries/LibJS/Tests/modulo-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(10 % 3 === 1);
assert(10.5 % 2.5 === 0.5);
diff --git a/Libraries/LibJS/Tests/parser-unary-associativity.js b/Libraries/LibJS/Tests/parser-unary-associativity.js
index baa38e0850..1bc9b05f8e 100644
--- a/Libraries/LibJS/Tests/parser-unary-associativity.js
+++ b/Libraries/LibJS/Tests/parser-unary-associativity.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var o = {};
o.a = 1;
diff --git a/Libraries/LibJS/Tests/run-tests b/Libraries/LibJS/Tests/run-tests
index fbe8951bb0..346039fef1 100755
--- a/Libraries/LibJS/Tests/run-tests
+++ b/Libraries/LibJS/Tests/run-tests
@@ -14,7 +14,7 @@ fail_count=0
count=0
for f in *.js; do
- result=`$js_program $f`
+ result=`$js_program -t $f`
if [ "$result" = "PASS" ]; then
let pass_count++
echo -ne "( \033[32;1mPass\033[0m ) "
diff --git a/Libraries/LibJS/Tests/switch-break.js b/Libraries/LibJS/Tests/switch-break.js
index 976e102092..2b57f02723 100644
--- a/Libraries/LibJS/Tests/switch-break.js
+++ b/Libraries/LibJS/Tests/switch-break.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var i = 0;
var three;
diff --git a/Libraries/LibJS/Tests/ternary-basic.js b/Libraries/LibJS/Tests/ternary-basic.js
index 62de660275..72aad18369 100644
--- a/Libraries/LibJS/Tests/ternary-basic.js
+++ b/Libraries/LibJS/Tests/ternary-basic.js
@@ -1,10 +1,8 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var x = 1;
assert(x === 1 ? true : false);
- assert(x ? x : 0);
+ assert((x ? x : 0) === x);
assert(1 < 2 ? (true) : (false));
var o = {};
diff --git a/Libraries/LibJS/Tests/throw-basic.js b/Libraries/LibJS/Tests/throw-basic.js
index 6cf2c0fe58..6751d01d38 100644
--- a/Libraries/LibJS/Tests/throw-basic.js
+++ b/Libraries/LibJS/Tests/throw-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) console.log("FAIL"); }
-
try {
throw 1;
} catch (e) {
diff --git a/Libraries/LibJS/Tests/to-number-basic.js b/Libraries/LibJS/Tests/to-number-basic.js
index a2e87ce527..ad5c31ad76 100644
--- a/Libraries/LibJS/Tests/to-number-basic.js
+++ b/Libraries/LibJS/Tests/to-number-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(+false === 0);
assert(-false === 0);
diff --git a/Libraries/LibJS/Tests/typeof-basic.js b/Libraries/LibJS/Tests/typeof-basic.js
index 110d01dcb6..ee0d67eaa3 100644
--- a/Libraries/LibJS/Tests/typeof-basic.js
+++ b/Libraries/LibJS/Tests/typeof-basic.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
assert(typeof "foo" === "string");
assert(!(typeof "foo" !== "string"));
diff --git a/Libraries/LibJS/Tests/var-multiple-declarator.js b/Libraries/LibJS/Tests/var-multiple-declarator.js
index 79098eb68e..49c76e276b 100644
--- a/Libraries/LibJS/Tests/var-multiple-declarator.js
+++ b/Libraries/LibJS/Tests/var-multiple-declarator.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
try {
var a = 1, b = 2, c = a + b;
assert(a === 1);
diff --git a/Libraries/LibJS/Tests/variable-undefined.js b/Libraries/LibJS/Tests/variable-undefined.js
index 61ee23a0d5..1ad67efb41 100644
--- a/Libraries/LibJS/Tests/variable-undefined.js
+++ b/Libraries/LibJS/Tests/variable-undefined.js
@@ -1,5 +1,3 @@
-function assert(x) { if (!x) throw 1; }
-
function foo(a) {
return a;
}