diff --git a/Libraries/LibJS/Tests/Array.js b/Libraries/LibJS/Tests/Array.js index 87cd168e35c..519bb54d8b6 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 4cb895f5ab5..c6ce64554be 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 14945562991..97f748744b0 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 53eb00d6bbf..5459242cd4b 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 d8a9df88a37..e70dc7623c6 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 572dd57b737..631f386ae36 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 1f5b9a443d5..6a102f23956 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 799e1e2247e..b09e000a6e1 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 04f7e82b401..95f9d199161 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 13910bbd994..bf09c0278e4 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 4ece401aca3..a6503b9b324 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 b3cd3524733..e96272f9d60 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 4f1da2db8d6..a7a54ee3fc5 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 713fc4e884c..ddf78f28a9a 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 cc0b8185c0b..88a785fc235 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 5618aa52195..1f4b232b6be 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 22d14194ff7..04f2fbd71b2 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 da24707511a..30e7725896b 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 a1fd3c7252e..0d52bc79405 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 c86ff0114de..33164410f49 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 aeb224920f3..35940775cb3 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 5224f168cbd..0c2ed1e0ab6 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 a8507c5eb65..9ed8ff89604 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 dc4e8569ebc..1f27e1775cc 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 c8574d71cf2..07a57e6507d 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 29a9f1ad2a4..ec2bf0c5370 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 b0f2956c725..b9a02bc4252 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 a9673c03cf0..990dbf28011 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 6b48fc28b8f..08ccc6a0da8 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 9a47401bf5a..225394939fe 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 237de47a986..0d794442d5e 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 a56a3778708..2672b70f1b4 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 741e89e2ec0..994fed659d4 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 3c84a4ece8b..117093b61eb 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 38ac98d4a2d..fe7c5116815 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 cc06f8925aa..7298fab6721 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 3d2569d099a..5d4f118a7cb 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 81a772d9e6f..704a00349eb 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 eda0648f08d..a0d59cdeb60 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 f0ca39136f4..5ca6d50791c 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 2fe47e25a97..b26804a3169 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 b7fcb5b1e66..c68c2b99722 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 817aea2fbb2..8c54819a2d9 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 204fc7e495d..1939e01f069 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 e24f08e4907..7a3e69cc32e 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 8bef98e4f60..48810a38e76 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 23bf80937cf..efa8d6bfea3 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 5fa9805aa6a..0db8dbdc0a2 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 58d05e1111c..de7ff65fd70 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 105281f62fb..a666255ac71 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 7d0e894405a..4f35c2b3eab 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 baa38e0850f..1bc9b05f8e6 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 fbe8951bb0f..346039fef18 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 976e102092a..2b57f027230 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 62de660275f..72aad183695 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 6cf2c0fe58a..6751d01d386 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 a2e87ce5278..ad5c31ad768 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 110d01dcb61..ee0d67eaa39 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 79098eb68e2..49c76e276b2 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 61ee23a0d55..1ad67efb414 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; }