diff --git a/tests/ecmascript/.editorconfig b/tests/ecmascript/.editorconfig new file mode 100644 index 00000000..732807c4 --- /dev/null +++ b/tests/ecmascript/.editorconfig @@ -0,0 +1,8 @@ +# https://editorconfig.org/ +# +# Approximate configuration for the Duktape code base. + +# Don't trim trailing whitespace because some testcase expect values +# have trailing whitespace. +[*.js] +trim_trailing_whitespace = false diff --git a/tests/ecmascript/test-bug-act-linenumber-gh143.js b/tests/ecmascript/test-bug-act-linenumber-gh143.js index 18f3b70b..d1235a76 100644 --- a/tests/ecmascript/test-bug-act-linenumber-gh143.js +++ b/tests/ecmascript/test-bug-act-linenumber-gh143.js @@ -2,17 +2,21 @@ * https://github.com/svaarala/duktape/issues/143 */ +/*--- +custom: true +---*/ + /*=== -1 0 --2 19 --3 21 --4 25 -21 +-2 23 +-3 25 +-4 29 +25 -1 0 --2 19 --3 22 --4 25 -22 +-2 23 +-3 26 +-4 29 +26 ===*/ (function() { diff --git a/tests/ecmascript/test-bug-array-fastpath-push-retval.js b/tests/ecmascript/test-bug-array-fastpath-push-retval.js index a83a16b2..05a98187 100644 --- a/tests/ecmascript/test-bug-array-fastpath-push-retval.js +++ b/tests/ecmascript/test-bug-array-fastpath-push-retval.js @@ -12,8 +12,4 @@ function test() { print(typeof ret, ret); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-array-proto-protected-1.js b/tests/ecmascript/test-bug-array-proto-protected-1.js index 94f3a388..b7ca9518 100644 --- a/tests/ecmascript/test-bug-array-proto-protected-1.js +++ b/tests/ecmascript/test-bug-array-proto-protected-1.js @@ -46,8 +46,4 @@ function test() { print(arr.length, arr[0], arr[1]); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-array-slice-end.js b/tests/ecmascript/test-bug-array-slice-end.js index 6d43e900..0e2a3703 100644 --- a/tests/ecmascript/test-bug-array-slice-end.js +++ b/tests/ecmascript/test-bug-array-slice-end.js @@ -5,9 +5,5 @@ /* Broken at some point: end would not default to 'length' */ -try { - print([1,2,3,4,5].slice(2)); - print([1,2,3,4,5].slice(2, 5)); -} catch (e) { - print(e); -} +print([1,2,3,4,5].slice(2)); +print([1,2,3,4,5].slice(2, 5)); diff --git a/tests/ecmascript/test-bug-arridx-1.js b/tests/ecmascript/test-bug-arridx-1.js index fff567f6..610c7ba7 100644 --- a/tests/ecmascript/test-bug-arridx-1.js +++ b/tests/ecmascript/test-bug-arridx-1.js @@ -9,11 +9,7 @@ quux undefined ===*/ -try { - var arr = [ 'foo', 'bar', 'quux', 'baz' ]; - print(arr[2]); - print(arr['2']); - print(arr['02']); // should be undefined, '02' is not an array index compatible string -} catch (e) { - print(e); -} +var arr = [ 'foo', 'bar', 'quux', 'baz' ]; +print(arr[2]); +print(arr['2']); +print(arr['02']); // should be undefined, '02' is not an array index compatible string diff --git a/tests/ecmascript/test-bug-assert-cbor-encode-gh2316.js b/tests/ecmascript/test-bug-assert-cbor-encode-gh2316.js index 30793ab8..880f1347 100644 --- a/tests/ecmascript/test-bug-assert-cbor-encode-gh2316.js +++ b/tests/ecmascript/test-bug-assert-cbor-encode-gh2316.js @@ -1,7 +1,10 @@ // https://github.com/svaarala/duktape/issues/2316 +/*--- +custom: true +---*/ + /*=== -done ===*/ function main() { @@ -10,4 +13,3 @@ function main() { var v5 = CBOR.encode(v4); } main(); -print('done'); diff --git a/tests/ecmascript/test-bug-assert-property-add-gh2315.js b/tests/ecmascript/test-bug-assert-property-add-gh2315.js index 0f15864f..8427f488 100644 --- a/tests/ecmascript/test-bug-assert-property-add-gh2315.js +++ b/tests/ecmascript/test-bug-assert-property-add-gh2315.js @@ -1,7 +1,6 @@ // https://github.com/svaarala/duktape/issues/2315 /*=== -done ===*/ function main() { @@ -15,4 +14,3 @@ function main() { } } main(); -print('done'); diff --git a/tests/ecmascript/test-bug-assign-mutate-gh381.js b/tests/ecmascript/test-bug-assign-mutate-gh381.js index f0211624..f84cff10 100644 --- a/tests/ecmascript/test-bug-assign-mutate-gh381.js +++ b/tests/ecmascript/test-bug-assign-mutate-gh381.js @@ -34,8 +34,4 @@ function test() { print( (x = y) + (y = 30) ); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-autosemi-1.js b/tests/ecmascript/test-bug-autosemi-1.js index c68e1786..7d3950b8 100644 --- a/tests/ecmascript/test-bug-autosemi-1.js +++ b/tests/ecmascript/test-bug-autosemi-1.js @@ -25,8 +25,4 @@ function f_postinc() { print('->', x, y); } -try { - f_postinc(); -} catch (e) { - print(e.name); -} +f_postinc(); diff --git a/tests/ecmascript/test-bug-base64-dec-whitespace-padding.js b/tests/ecmascript/test-bug-base64-dec-whitespace-padding.js index 6a1ddf9b..7077ec19 100644 --- a/tests/ecmascript/test-bug-base64-dec-whitespace-padding.js +++ b/tests/ecmascript/test-bug-base64-dec-whitespace-padding.js @@ -5,6 +5,10 @@ /*@include util-buffer.js@*/ +/*--- +custom: true +---*/ + /*=== foo foo @@ -50,8 +54,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-base64-dec-zerolen-dynamic-buffer-gh2027.js b/tests/ecmascript/test-bug-base64-dec-zerolen-dynamic-buffer-gh2027.js index 7d43adc0..e432a8f7 100644 --- a/tests/ecmascript/test-bug-base64-dec-zerolen-dynamic-buffer-gh2027.js +++ b/tests/ecmascript/test-bug-base64-dec-zerolen-dynamic-buffer-gh2027.js @@ -1,11 +1,13 @@ +/*--- +custom: true +---*/ + /*=== t1 t2 -done ===*/ print('t1'); var t1 = Duktape.dec('base64', ''); // create zero-size dynamic plain buffer print('t2'); var t2 = Duktape.dec('base64', t1); // segfault -print('done'); diff --git a/tests/ecmascript/test-bug-bound-constructable-judofyr.js b/tests/ecmascript/test-bug-bound-constructable-judofyr.js index 38b28e6f..50ba4da5 100644 --- a/tests/ecmascript/test-bug-bound-constructable-judofyr.js +++ b/tests/ecmascript/test-bug-bound-constructable-judofyr.js @@ -25,8 +25,4 @@ function test() { print(obj.value); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-bound-func-caller-arguments.js b/tests/ecmascript/test-bug-bound-func-caller-arguments.js index 974cf265..2a97e2bc 100644 --- a/tests/ecmascript/test-bug-bound-func-caller-arguments.js +++ b/tests/ecmascript/test-bug-bound-func-caller-arguments.js @@ -16,16 +16,12 @@ function test(obj, prop) { print(prop, prop in obj); } -try { - f = function() {}; - test(f, 'length'); - test(f, 'prototype'); +f = function() {}; +test(f, 'length'); +test(f, 'prototype'); - // bound function does not have a 'prototype' - g = f.bind(null); - test(g, 'length'); - test(g, 'caller'); - test(g, 'arguments'); -} catch (e) { - print(e); -} +// bound function does not have a 'prototype' +g = f.bind(null); +test(g, 'length'); +test(g, 'caller'); +test(g, 'arguments'); diff --git a/tests/ecmascript/test-bug-buffer-assign-x.js b/tests/ecmascript/test-bug-buffer-assign-x.js index b7490623..9f4af013 100644 --- a/tests/ecmascript/test-bug-buffer-assign-x.js +++ b/tests/ecmascript/test-bug-buffer-assign-x.js @@ -3,19 +3,19 @@ * instead of 0. */ +/*--- +custom: true +---*/ + /*=== 0 0 ===*/ -try { - var buf = new ArrayBuffer(1); // Buffer object - new Uint8Array(buf)[0] = 'x'; - print(new Uint8Array(buf)[0]); +var buf = new ArrayBuffer(1); // Buffer object +new Uint8Array(buf)[0] = 'x'; +print(new Uint8Array(buf)[0]); - buf = Duktape.dec('hex', '12'); // plain buffer - buf[0] = 'x'; - print(buf[0]); -} catch (e) { - print(e.stack || e); -} +buf = Duktape.dec('hex', '12'); // plain buffer +buf[0] = 'x'; +print(buf[0]); diff --git a/tests/ecmascript/test-bug-bufferobject-cast-gh336.js b/tests/ecmascript/test-bug-bufferobject-cast-gh336.js index b800b17f..f3a4b829 100644 --- a/tests/ecmascript/test-bug-bufferobject-cast-gh336.js +++ b/tests/ecmascript/test-bug-bufferobject-cast-gh336.js @@ -18,9 +18,7 @@ /*@include util-buffer.js@*/ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -42,8 +40,4 @@ function test() { print(Duktape.enc('jx', createPlainBuffer(b))); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-call-valstack-segfault-gh107.js b/tests/ecmascript/test-bug-call-valstack-segfault-gh107.js index 77191cf3..b8ba7e1b 100644 --- a/tests/ecmascript/test-bug-call-valstack-segfault-gh107.js +++ b/tests/ecmascript/test-bug-call-valstack-segfault-gh107.js @@ -11,8 +11,4 @@ function test() { print('still here'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-case-fallthrough.js b/tests/ecmascript/test-bug-case-fallthrough.js index bc7eadad..1905c41a 100644 --- a/tests/ecmascript/test-bug-case-fallthrough.js +++ b/tests/ecmascript/test-bug-case-fallthrough.js @@ -75,26 +75,7 @@ function test2a() { } } -try { - test1a(); -} catch (e) { - print(e); -} - -try { - test1b(); -} catch (e) { - print(e); -} - -try { - test1c(); -} catch (e) { - print(e); -} - -try { - test2a(); -} catch (e) { - print(e); -} +test1a(); +test1b(); +test1c(); +test2a(); diff --git a/tests/ecmascript/test-bug-cbor-reclimit-gh2327.js b/tests/ecmascript/test-bug-cbor-reclimit-gh2327.js index 7e53f446..4dc1f5c5 100644 --- a/tests/ecmascript/test-bug-cbor-reclimit-gh2327.js +++ b/tests/ecmascript/test-bug-cbor-reclimit-gh2327.js @@ -3,14 +3,11 @@ */ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== RangeError -done ===*/ function main() { @@ -22,9 +19,9 @@ function main() { var v9 = new Proxy(v8,v8); var v10 = CBOR.encode(v9); } + try { main(); } catch (e) { print(e.name); } -print('done'); diff --git a/tests/ecmascript/test-bug-comma-expr-gh131.js b/tests/ecmascript/test-bug-comma-expr-gh131.js index a405ab4d..1a275a7b 100644 --- a/tests/ecmascript/test-bug-comma-expr-gh131.js +++ b/tests/ecmascript/test-bug-comma-expr-gh131.js @@ -83,21 +83,17 @@ function test5notail() { return (function() { var a = 1; return (function() { 'use duk notail'; a = 2 })(), a })(); } -try { - print('test1', test1()); - print('test1notail', test1notail()); - print('test1var', test1var()); - print('test2', test2()); - print('test2notail', test2notail()); - print('test2var', test2var()); - print('test3', test3()); - print('test3notail', test3notail()); - print('test3var', test3var()); - print('test4', test4()); - print('test4notail', test4notail()); - print('test4var', test4var()); - print('test5', test5()); - print('test5notail', test5notail()); -} catch (e) { - print(e.stack || e); -} +print('test1', test1()); +print('test1notail', test1notail()); +print('test1var', test1var()); +print('test2', test2()); +print('test2notail', test2notail()); +print('test2var', test2var()); +print('test3', test3()); +print('test3notail', test3notail()); +print('test3var', test3var()); +print('test4', test4()); +print('test4notail', test4notail()); +print('test4var', test4var()); +print('test5', test5()); +print('test5notail', test5notail()); diff --git a/tests/ecmascript/test-bug-commonjs-relative-id.js b/tests/ecmascript/test-bug-commonjs-relative-id.js index 96f1431c..50280494 100644 --- a/tests/ecmascript/test-bug-commonjs-relative-id.js +++ b/tests/ecmascript/test-bug-commonjs-relative-id.js @@ -49,8 +49,4 @@ function test() { void require('foo/bar'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-compare-eval-order.js b/tests/ecmascript/test-bug-compare-eval-order.js index 0beb52e5..b3b64f31 100644 --- a/tests/ecmascript/test-bug-compare-eval-order.js +++ b/tests/ecmascript/test-bug-compare-eval-order.js @@ -42,8 +42,4 @@ function test() { print(getObject('obj1', 2) >= getObject('obj2', 1)); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-compiler-gh2025.js b/tests/ecmascript/test-bug-compiler-gh2025.js index 00655271..9ff39cca 100644 --- a/tests/ecmascript/test-bug-compiler-gh2025.js +++ b/tests/ecmascript/test-bug-compiler-gh2025.js @@ -1,7 +1,6 @@ /*=== A B -done ===*/ var j; @@ -10,4 +9,3 @@ print('A'); Object.defineProperty(Array.prototype, "0", { set: function () {}, configurable: true }); print('B'); eval( 'for (j in this){\nstr+=j;\n}' ); -print('done'); diff --git a/tests/ecmascript/test-bug-compiler-gh2026.js b/tests/ecmascript/test-bug-compiler-gh2026.js index c0dc59d0..ed3ec2fc 100644 --- a/tests/ecmascript/test-bug-compiler-gh2026.js +++ b/tests/ecmascript/test-bug-compiler-gh2026.js @@ -1,11 +1,9 @@ /*=== A B -done ===*/ print('A'); Object.defineProperty(Array.prototype, 0, { set: function () {} }); print('B'); eval("function\u0009\u2029w(\u000c)\u00a0{\u000d};"); -print('done'); diff --git a/tests/ecmascript/test-bug-compiler-gh2033.js b/tests/ecmascript/test-bug-compiler-gh2033.js index 065df15c..702afaec 100644 --- a/tests/ecmascript/test-bug-compiler-gh2033.js +++ b/tests/ecmascript/test-bug-compiler-gh2033.js @@ -1,11 +1,9 @@ /*=== A B -done ===*/ print('A'); Object.defineProperty(Array.prototype, 0, { set : function( ) {} }); print('B'); eval('if (true) {} /foo/.test("foo")'); -print('done'); diff --git a/tests/ecmascript/test-bug-compiler-gh2035.js b/tests/ecmascript/test-bug-compiler-gh2035.js index 30760cd3..411608ce 100644 --- a/tests/ecmascript/test-bug-compiler-gh2035.js +++ b/tests/ecmascript/test-bug-compiler-gh2035.js @@ -1,11 +1,9 @@ /*=== A B -done ===*/ print('A'); Object.defineProperty(Array.prototype, 2, { get : Math.random, set : function f ( ) { } } ) ; print('B'); eval ( "function\u0009\u2029w(\u000C)\u00A0{\u000D};" ) ; -print('done'); diff --git a/tests/ecmascript/test-bug-compiler-gh2036.js b/tests/ecmascript/test-bug-compiler-gh2036.js index 15620a3d..d5a4bfc1 100644 --- a/tests/ecmascript/test-bug-compiler-gh2036.js +++ b/tests/ecmascript/test-bug-compiler-gh2036.js @@ -1,11 +1,9 @@ /*=== A B -done ===*/ print('A'); Object.defineProperty(Array.prototype, 0, { get : Math.asin, set : function f( ) { } }); print('B'); eval('([ 123 ] / 2)'); -print('done'); diff --git a/tests/ecmascript/test-bug-const-overflow.js b/tests/ecmascript/test-bug-const-overflow.js index e1999c6f..8a61e2f8 100644 --- a/tests/ecmascript/test-bug-const-overflow.js +++ b/tests/ecmascript/test-bug-const-overflow.js @@ -171,8 +171,4 @@ function test() {\ }\ "; -try { - eval(test_source + "; test();"); -} catch (e) { - print(e); -} +eval(test_source + "; test();"); diff --git a/tests/ecmascript/test-bug-coroutine-yield-refzero-1-gh2204.js b/tests/ecmascript/test-bug-coroutine-yield-refzero-1-gh2204.js index 02417090..93f717de 100644 --- a/tests/ecmascript/test-bug-coroutine-yield-refzero-1-gh2204.js +++ b/tests/ecmascript/test-bug-coroutine-yield-refzero-1-gh2204.js @@ -1,5 +1,9 @@ // https://github.com/svaarala/duktape/issues/2204 +/*--- +custom: true +---*/ + /*=== 0 done diff --git a/tests/ecmascript/test-bug-coroutine-yield-refzero-2-gh2204.js b/tests/ecmascript/test-bug-coroutine-yield-refzero-2-gh2204.js index 0d37c22b..46cc4ace 100644 --- a/tests/ecmascript/test-bug-coroutine-yield-refzero-2-gh2204.js +++ b/tests/ecmascript/test-bug-coroutine-yield-refzero-2-gh2204.js @@ -1,3 +1,7 @@ +/*--- +custom: true +---*/ + /*=== RangeError: aiee done diff --git a/tests/ecmascript/test-bug-currpc-blit-gh294.js b/tests/ecmascript/test-bug-currpc-blit-gh294.js index ef0d88cb..177e34b8 100644 --- a/tests/ecmascript/test-bug-currpc-blit-gh294.js +++ b/tests/ecmascript/test-bug-currpc-blit-gh294.js @@ -4,7 +4,6 @@ /*=== blitMask 11 52 123 -done ===*/ function Image() { @@ -34,4 +33,3 @@ this.blit = function(x, y, alpha) { }; this.blit(1,2,3); -print('done'); diff --git a/tests/ecmascript/test-bug-currpc-sync-gh294.js b/tests/ecmascript/test-bug-currpc-sync-gh294.js index 5417c74f..5c3cc62d 100644 --- a/tests/ecmascript/test-bug-currpc-sync-gh294.js +++ b/tests/ecmascript/test-bug-currpc-sync-gh294.js @@ -2,13 +2,17 @@ * Some curr_pc sync bugs when developing GH-294. */ +/*--- +custom: true +---*/ + /*=== calling inner inner called -1 0 --2 23 --3 30 --4 35 +-2 27 +-3 34 +-4 39 inner returned ===*/ @@ -41,11 +45,10 @@ try { testing getter called -1 0 --2 62 --3 70 --4 75 +-2 65 +-3 73 +-4 76 123 -done ===*/ /* The executor may do an automatic function call when it accesses a setter. @@ -68,11 +71,6 @@ function sideEffectTest() { print('testing'); print(obj.prop); - print('done'); } -try { - sideEffectTest(); -} catch (e) { - print(e.stack || e); -} +sideEffectTest(); diff --git a/tests/ecmascript/test-bug-currpc-unwind-gh294.js b/tests/ecmascript/test-bug-currpc-unwind-gh294.js index 1e6322f5..76b1c086 100644 --- a/tests/ecmascript/test-bug-currpc-unwind-gh294.js +++ b/tests/ecmascript/test-bug-currpc-unwind-gh294.js @@ -2,6 +2,10 @@ * Unwind and thr->ptr_curr_pc related bug when developing GH-294. */ +/*--- +custom: true +---*/ + /*=== returning obj finalized @@ -38,9 +42,5 @@ function test() { func(); } -try { - test(); - print('done'); -} catch (e) { - print(e.stack || e); -} +test(); +print('done'); diff --git a/tests/ecmascript/test-bug-date-insane-setyear.js b/tests/ecmascript/test-bug-date-insane-setyear.js index 32007dd5..23c8b201 100644 --- a/tests/ecmascript/test-bug-date-insane-setyear.js +++ b/tests/ecmascript/test-bug-date-insane-setyear.js @@ -10,7 +10,6 @@ about to set year year set ok Invalid Date -done ===*/ function test() { @@ -21,9 +20,4 @@ function test() { print(d); } -try { - test(); -} catch (e) { - print(e); -} -print('done'); +test(); diff --git a/tests/ecmascript/test-bug-date-nan-tzoffset.js b/tests/ecmascript/test-bug-date-nan-tzoffset.js index edff60a4..a1c80b02 100644 --- a/tests/ecmascript/test-bug-date-nan-tzoffset.js +++ b/tests/ecmascript/test-bug-date-nan-tzoffset.js @@ -2,9 +2,5 @@ NaN ===*/ -try { - var d = new Date(NaN); - print(d.getTimezoneOffset()); -} catch (e) { - print(e); -} +var d = new Date(NaN); +print(d.getTimezoneOffset()); diff --git a/tests/ecmascript/test-bug-date-setyear-overflow.js b/tests/ecmascript/test-bug-date-setyear-overflow.js index 7cb81167..24361a2f 100644 --- a/tests/ecmascript/test-bug-date-setyear-overflow.js +++ b/tests/ecmascript/test-bug-date-setyear-overflow.js @@ -9,7 +9,6 @@ /*=== RangeError -done ===*/ function test() { @@ -22,9 +21,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e.stack || e); -} -print('done'); +test(); diff --git a/tests/ecmascript/test-bug-date-timeval-edges.js b/tests/ecmascript/test-bug-date-timeval-edges.js index 94d7dbfb..08c46891 100644 --- a/tests/ecmascript/test-bug-date-timeval-edges.js +++ b/tests/ecmascript/test-bug-date-timeval-edges.js @@ -108,23 +108,11 @@ function test3() { }); } -try { - print('test1'); - test1(); -} catch (e) { - print(e.stack || e); -} +print('test1'); +test1(); -try { - print('test2'); - test2(); -} catch (e) { - print(e.stack || e); -} +print('test2'); +test2(); -try { - print('test3'); - test3(); -} catch (e) { - print(e.stack || e); -} +print('test3'); +test3(); diff --git a/tests/ecmascript/test-bug-dowhile-with-break.js b/tests/ecmascript/test-bug-dowhile-with-break.js index d8620ddf..a0f29ae3 100644 --- a/tests/ecmascript/test-bug-dowhile-with-break.js +++ b/tests/ecmascript/test-bug-dowhile-with-break.js @@ -46,17 +46,7 @@ function test2() { } print('test1'); - -try { - test1(); -} catch (e) { - print(e); -} +test1(); print('test2'); - -try { - test2(); -} catch (e) { - print(e); -} +test2(); diff --git a/tests/ecmascript/test-bug-duktape-gc-retval.js b/tests/ecmascript/test-bug-duktape-gc-retval.js index 2de33db6..9318909d 100644 --- a/tests/ecmascript/test-bug-duktape-gc-retval.js +++ b/tests/ecmascript/test-bug-duktape-gc-retval.js @@ -4,12 +4,12 @@ * 0 means success so that Duktape.gc() would return false on success. */ +/*--- +custom: true +---*/ + /*=== true ===*/ -try { - print(Duktape.gc()); -} catch (e) { - print(e.stack || e); -} +print(Duktape.gc()); diff --git a/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js b/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js index 2b7dbe5d..4d8b41d3 100644 --- a/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js +++ b/tests/ecmascript/test-bug-empty-finally-segfault-gh268.js @@ -9,9 +9,5 @@ still here /* For the bug to be triggered, the function being compiled must not contain * any constants and the try-finally must not have a catch clause. */ -try { - eval('try {} finally {}'); -} catch (e) { - print(e.stack || e); -} +eval('try {} finally {}'); print('still here'); diff --git a/tests/ecmascript/test-bug-enum-shadow-nonenumerable.js b/tests/ecmascript/test-bug-enum-shadow-nonenumerable.js index 6f65d2c1..97426f9d 100644 --- a/tests/ecmascript/test-bug-enum-shadow-nonenumerable.js +++ b/tests/ecmascript/test-bug-enum-shadow-nonenumerable.js @@ -66,15 +66,7 @@ function test2() { } print('test1'); -try { - test1(); -} catch (e) { - print(e); -} +test1(); print('test2'); -try { - test2(); -} catch (e) { - print(e); -} +test2(); diff --git a/tests/ecmascript/test-bug-enum-shuffle-gh132.js b/tests/ecmascript/test-bug-enum-shuffle-gh132.js index 40f3ffbf..915bd002 100644 --- a/tests/ecmascript/test-bug-enum-shuffle-gh132.js +++ b/tests/ecmascript/test-bug-enum-shuffle-gh132.js @@ -44,8 +44,4 @@ function test() { print('done'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-envclose-assert-gh2022.js b/tests/ecmascript/test-bug-envclose-assert-gh2022.js index 6b411b19..16984c14 100644 --- a/tests/ecmascript/test-bug-envclose-assert-gh2022.js +++ b/tests/ecmascript/test-bug-envclose-assert-gh2022.js @@ -16,10 +16,5 @@ function test ( ) { var f = eval( f ); } -try { - test(); -} catch (e) { - print(e.stack || e); -} - +test(); print('done'); diff --git a/tests/ecmascript/test-bug-error-linenumber-1.js b/tests/ecmascript/test-bug-error-linenumber-1.js index 499794d5..cdabcda7 100644 --- a/tests/ecmascript/test-bug-error-linenumber-1.js +++ b/tests/ecmascript/test-bug-error-linenumber-1.js @@ -45,8 +45,4 @@ function test() { evalCheck("\nprint('line 2')\n" + rep('\n', 200) + "if (null.foo) {}"); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-error-linenumber-2.js b/tests/ecmascript/test-bug-error-linenumber-2.js index 1d81bcb9..8c41f160 100644 --- a/tests/ecmascript/test-bug-error-linenumber-2.js +++ b/tests/ecmascript/test-bug-error-linenumber-2.js @@ -46,8 +46,4 @@ function test() { evalCheck("\nprint('line 2')\n\n\n\n\n\n\n\nthis.nonexistent.foo = 1;"); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-error-tostring-replacement-gh254.js b/tests/ecmascript/test-bug-error-tostring-replacement-gh254.js index d44a66bd..f48969d0 100644 --- a/tests/ecmascript/test-bug-error-tostring-replacement-gh254.js +++ b/tests/ecmascript/test-bug-error-tostring-replacement-gh254.js @@ -9,9 +9,7 @@ */ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -43,8 +41,4 @@ function testErrorToStringReplacement() { } } -try { - testErrorToStringReplacement(); -} catch (e) { - print(e.stack || e); -} +testErrorToStringReplacement(); diff --git a/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-1.js b/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-1.js index 6db9a741..7cde80a5 100644 --- a/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-1.js +++ b/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-1.js @@ -2,6 +2,10 @@ * https://github.com/svaarala/duktape/issues/2030 */ +/*--- +custom: true +---*/ + /*=== done ===*/ diff --git a/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-2.js b/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-2.js index 8be09613..befd4b79 100644 --- a/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-2.js +++ b/tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-2.js @@ -4,6 +4,10 @@ * Testcase adapted a bit in this version. */ +/*--- +custom: true +---*/ + /*=== done finalizer called diff --git a/tests/ecmascript/test-bug-finalizer-repro-gh1311.js b/tests/ecmascript/test-bug-finalizer-repro-gh1311.js index 56cb60dc..fd1c219b 100644 --- a/tests/ecmascript/test-bug-finalizer-repro-gh1311.js +++ b/tests/ecmascript/test-bug-finalizer-repro-gh1311.js @@ -2,6 +2,10 @@ * Pure JS repro for one issue in https://github.com/svaarala/duktape/issues/1311. */ +/*--- +custom: true +---*/ + /*=== Error: a pig ate it done diff --git a/tests/ecmascript/test-bug-finalizer-rescue.js b/tests/ecmascript/test-bug-finalizer-rescue.js index 009a39c3..dfca4a7d 100644 --- a/tests/ecmascript/test-bug-finalizer-rescue.js +++ b/tests/ecmascript/test-bug-finalizer-rescue.js @@ -1,7 +1,5 @@ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== diff --git a/tests/ecmascript/test-bug-finally-ljtype-gh287.js b/tests/ecmascript/test-bug-finally-ljtype-gh287.js index 8aa871af..125d9a92 100644 --- a/tests/ecmascript/test-bug-finally-ljtype-gh287.js +++ b/tests/ecmascript/test-bug-finally-ljtype-gh287.js @@ -3,11 +3,14 @@ * 'finally' caused an internal error (GH-287). */ +/*--- +custom: true +---*/ + /*=== The pig ate all the food, and then... *munch* Error: A pig ate everyone at 8:12 -done ===*/ function test() { @@ -32,4 +35,3 @@ try { } catch (e) { print(e); } -print('done'); diff --git a/tests/ecmascript/test-bug-for-multivar.js b/tests/ecmascript/test-bug-for-multivar.js index 7297c75c..0078a60b 100644 --- a/tests/ecmascript/test-bug-for-multivar.js +++ b/tests/ecmascript/test-bug-for-multivar.js @@ -4,8 +4,4 @@ /* This broke at some point. */ -try { - for (var a=1, b=2; ; ) { print(a,b); break; } -} catch (e) { - print(e); -} +for (var a=1, b=2; ; ) { print(a,b); break; } diff --git a/tests/ecmascript/test-bug-fromcharcode-argcount.js b/tests/ecmascript/test-bug-fromcharcode-argcount.js index 40e71464..101d1730 100644 --- a/tests/ecmascript/test-bug-fromcharcode-argcount.js +++ b/tests/ecmascript/test-bug-fromcharcode-argcount.js @@ -19,31 +19,27 @@ function test(count) { return eval(src.join('')); } -try { - var t; +var t; - try { - t = test(250); - print(t.length); - print(t); - } catch (e) { - print(e.name); - } +try { + t = test(250); + print(t.length); + print(t); +} catch (e) { + print(e.name); +} - /* This currently fails due to Duktape register count limits; the failure is - * not specific to String.fromCharCode(). However, String.fromCharCode() is - * an example of a function which could conceivably be used with a lot of - * arguments, to build a large Unicode string. - * - * Limit raised to ~64k in Duktape 2.2. - */ - try { - t = test(300); - print(t.length); - print(t); - } catch (e) { - print(e.name); - } +/* This currently fails due to Duktape register count limits; the failure is + * not specific to String.fromCharCode(). However, String.fromCharCode() is + * an example of a function which could conceivably be used with a lot of + * arguments, to build a large Unicode string. + * + * Limit raised to ~64k in Duktape 2.2. + */ +try { + t = test(300); + print(t.length); + print(t); } catch (e) { - print(e.stack || e); + print(e.name); } diff --git a/tests/ecmascript/test-bug-getownpropdesc-proto.js b/tests/ecmascript/test-bug-getownpropdesc-proto.js index d8159005..c5a12fa0 100644 --- a/tests/ecmascript/test-bug-getownpropdesc-proto.js +++ b/tests/ecmascript/test-bug-getownpropdesc-proto.js @@ -10,12 +10,8 @@ true * Once getOwnPropertyDescriptor() returned an object with null prototype. */ -try { - var obj = { foo: 1 }; - var pd = Object.getOwnPropertyDescriptor(obj, 'foo'); +var obj = { foo: 1 }; +var pd = Object.getOwnPropertyDescriptor(obj, 'foo'); - print(Object.getPrototypeOf(pd)); - print(Object.getPrototypeOf(pd) === Object.prototype); -} catch (e) { - print(e); -} +print(Object.getPrototypeOf(pd)); +print(Object.getPrototypeOf(pd) === Object.prototype); diff --git a/tests/ecmascript/test-bug-getpropc-errcreate-gh2061.js b/tests/ecmascript/test-bug-getpropc-errcreate-gh2061.js index 4c2e4b51..3ceee1b1 100644 --- a/tests/ecmascript/test-bug-getpropc-errcreate-gh2061.js +++ b/tests/ecmascript/test-bug-getpropc-errcreate-gh2061.js @@ -2,9 +2,12 @@ * Cleaned up repro from https://github.com/svaarala/duktape/issues/2061. */ +/*--- +custom: true +---*/ + /*=== true -done ===*/ try { @@ -15,4 +18,3 @@ try { } catch (e) { print(e === Float64Array); } -print('done'); diff --git a/tests/ecmascript/test-bug-getset-func-name.js b/tests/ecmascript/test-bug-getset-func-name.js index 2ce5e687..a53ca870 100644 --- a/tests/ecmascript/test-bug-getset-func-name.js +++ b/tests/ecmascript/test-bug-getset-func-name.js @@ -36,8 +36,4 @@ function test() { print('set.name:', pd.set.name); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-global-eval-redeclare.js b/tests/ecmascript/test-bug-global-eval-redeclare.js index 18dea53a..ede3224c 100644 --- a/tests/ecmascript/test-bug-global-eval-redeclare.js +++ b/tests/ecmascript/test-bug-global-eval-redeclare.js @@ -9,7 +9,6 @@ function fn called [object Math] [object Math] -done ===*/ var global = new Function('return this')(); @@ -34,5 +33,3 @@ try { print(Math); var Math; print(Math); - -print('done'); diff --git a/tests/ecmascript/test-bug-invalid-oct-as-dec.js b/tests/ecmascript/test-bug-invalid-oct-as-dec.js index 77b57fb8..6c9d6a1d 100644 --- a/tests/ecmascript/test-bug-invalid-oct-as-dec.js +++ b/tests/ecmascript/test-bug-invalid-oct-as-dec.js @@ -49,8 +49,4 @@ function octalTest() { p('099'); } -try { - octalTest(); -} catch (e) { - print(e); -} +octalTest(); diff --git a/tests/ecmascript/test-bug-isprototypeof-assert-gh1162.js b/tests/ecmascript/test-bug-isprototypeof-assert-gh1162.js index 325da7f2..9690cf0f 100644 --- a/tests/ecmascript/test-bug-isprototypeof-assert-gh1162.js +++ b/tests/ecmascript/test-bug-isprototypeof-assert-gh1162.js @@ -8,8 +8,4 @@ false ===*/ -try { - print(this.parseFloat.isPrototypeOf(this.Object.prototype)); -} catch (e) { - print(e.stack || e); -} +print(this.parseFloat.isPrototypeOf(this.Object.prototype)); diff --git a/tests/ecmascript/test-bug-json-bufobj.js b/tests/ecmascript/test-bug-json-bufobj.js index 547a4e67..cae8491a 100644 --- a/tests/ecmascript/test-bug-json-bufobj.js +++ b/tests/ecmascript/test-bug-json-bufobj.js @@ -9,6 +9,10 @@ /*@include util-buffer.js@*/ +/*--- +custom: true +---*/ + /*=== index: 0 json fast: {"0":0,"1":0,"2":0,"3":0} @@ -123,8 +127,4 @@ function test() { }); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-json-fastpath-boxedptr.js b/tests/ecmascript/test-bug-json-fastpath-boxedptr.js index 519ccf57..053f6fc0 100644 --- a/tests/ecmascript/test-bug-json-fastpath-boxedptr.js +++ b/tests/ecmascript/test-bug-json-fastpath-boxedptr.js @@ -3,6 +3,12 @@ * to be emitted as "{}" instead of being omitted. */ +/*--- +custom: true +duktape_config: + DUK_USE_JSON_STRINGIFY_FASTPATH: true +---*/ + /*=== [null,null] [null,null] @@ -16,8 +22,4 @@ function test() { print(JSON.stringify([ Duktape.Pointer('dummy'), new Duktape.Pointer('dummy') ], function id(k,v) { return v; })); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-json-fastpath-unbox-coercion.js b/tests/ecmascript/test-bug-json-fastpath-unbox-coercion.js index 19b497cb..14ad117f 100644 --- a/tests/ecmascript/test-bug-json-fastpath-unbox-coercion.js +++ b/tests/ecmascript/test-bug-json-fastpath-unbox-coercion.js @@ -46,11 +46,7 @@ function testNumberCoercion() { print(JSON.stringify(x)); } -try { - testNumberCoercion(); -} catch (e) { - print(e.stack || e); -} +testNumberCoercion(); /*=== my .toString() called @@ -87,8 +83,4 @@ function testStringCoercion() { print(JSON.stringify(x)); } -try { - testStringCoercion(); -} catch (e) { - print(e.stack || e); -} +testStringCoercion(); diff --git a/tests/ecmascript/test-bug-json-fastpath-unbox-recursion.js b/tests/ecmascript/test-bug-json-fastpath-unbox-recursion.js index 8b89baac..5bacf251 100644 --- a/tests/ecmascript/test-bug-json-fastpath-unbox-recursion.js +++ b/tests/ecmascript/test-bug-json-fastpath-unbox-recursion.js @@ -23,8 +23,4 @@ function test() { print(res.length); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-json-parse-__proto__.js b/tests/ecmascript/test-bug-json-parse-__proto__.js index 821453e7..c2034ede 100644 --- a/tests/ecmascript/test-bug-json-parse-__proto__.js +++ b/tests/ecmascript/test-bug-json-parse-__proto__.js @@ -99,8 +99,4 @@ function test() { })); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-json-parse-posexpt.js b/tests/ecmascript/test-bug-json-parse-posexpt.js index dc5b737d..c0b33d5f 100644 --- a/tests/ecmascript/test-bug-json-parse-posexpt.js +++ b/tests/ecmascript/test-bug-json-parse-posexpt.js @@ -17,14 +17,5 @@ function testEval() { print(eval('1.50e+2')); } -try { - testJson(); -} catch (e) { - print(e.stack || e); -} - -try { - testEval(); -} catch (e) { - print(e.stack || e); -} +testJson(); +testEval(); diff --git a/tests/ecmascript/test-bug-json-reviver-array-recursion.js b/tests/ecmascript/test-bug-json-reviver-array-recursion.js index 0890b05b..8c049206 100644 --- a/tests/ecmascript/test-bug-json-reviver-array-recursion.js +++ b/tests/ecmascript/test-bug-json-reviver-array-recursion.js @@ -4,7 +4,6 @@ /*=== RangeError -done ===*/ function b() { @@ -16,4 +15,3 @@ try { } catch (e) { print(e.name); } -print('done'); diff --git a/tests/ecmascript/test-bug-json-stringify-proplist-inherited-gh2202.js b/tests/ecmascript/test-bug-json-stringify-proplist-inherited-gh2202.js index 15c222a3..feb195ab 100644 --- a/tests/ecmascript/test-bug-json-stringify-proplist-inherited-gh2202.js +++ b/tests/ecmascript/test-bug-json-stringify-proplist-inherited-gh2202.js @@ -4,11 +4,9 @@ A B {} -done ===*/ print('A'); Object.defineProperty(Array.prototype, 0, { set: function () { } }) print('B'); print(String(JSON.stringify({ }, [ 0, 0]))); -print('done'); diff --git a/tests/ecmascript/test-bug-jx-minusinf.js b/tests/ecmascript/test-bug-jx-minusinf.js index 1538d7a6..501e878f 100644 --- a/tests/ecmascript/test-bug-jx-minusinf.js +++ b/tests/ecmascript/test-bug-jx-minusinf.js @@ -1,3 +1,7 @@ +/*--- +custom: true +---*/ + /*=== -Infinity SyntaxError @@ -14,8 +18,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-labelled-block.js b/tests/ecmascript/test-bug-labelled-block.js index db490323..09ba4b09 100644 --- a/tests/ecmascript/test-bug-labelled-block.js +++ b/tests/ecmascript/test-bug-labelled-block.js @@ -37,8 +37,4 @@ function labelledBlockTest() { print("after loop 2"); } -try { - labelledBlockTest(); -} catch (e) { - print(e); -} +labelledBlockTest(); diff --git a/tests/ecmascript/test-bug-labelled-stmts.js b/tests/ecmascript/test-bug-labelled-stmts.js index df3790c7..0d226f91 100644 --- a/tests/ecmascript/test-bug-labelled-stmts.js +++ b/tests/ecmascript/test-bug-labelled-stmts.js @@ -42,18 +42,6 @@ function testWith() { print('with 3'); } -try { - testIf(); -} catch (e) { - print(e.stack || e); -} -try { - testBlock(); -} catch (e) { - print(e.stack || e); -} -try { - testWith(); -} catch (e) { - print(e.stack || e); -} +testIf(); +testBlock(); +testWith(); diff --git a/tests/ecmascript/test-bug-lex-regexp-2.js b/tests/ecmascript/test-bug-lex-regexp-2.js index 0b0788a5..c084c6ee 100644 --- a/tests/ecmascript/test-bug-lex-regexp-2.js +++ b/tests/ecmascript/test-bug-lex-regexp-2.js @@ -6,30 +6,14 @@ true true true -done ===*/ var src1 = '/blah/.test("blah")'; var src2 = 'if (1==1) { /blah/.test("blah") }'; var src3 = 'if (1==1) /blah/.test("blah")'; -try { - print(eval(src1)); -} catch (e) { - print(e.stack || e); -} - -try { - print(eval(src2)); -} catch (e) { - print(e.stack || e); -} +print(eval(src1)); +print(eval(src2)); // This form failed to parse at least up to Duktape 2.2. -try { - print(eval(src3)); -} catch (e) { - print(e.stack || e); -} - -print('done'); +print(eval(src3)); diff --git a/tests/ecmascript/test-bug-localecompare-nul.js b/tests/ecmascript/test-bug-localecompare-nul.js index 8535b51a..f4bf0991 100644 --- a/tests/ecmascript/test-bug-localecompare-nul.js +++ b/tests/ecmascript/test-bug-localecompare-nul.js @@ -1,7 +1,5 @@ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -16,13 +14,9 @@ * a problem because strncmp() stops comparing at a NUL. */ -try { - print('foo\u0000f'.localeCompare('foo\u0000e')); - print('foo\u0000f'.localeCompare('foo\u0000f')); - print('foo\u0000f'.localeCompare('foo\u0000g')); +print('foo\u0000f'.localeCompare('foo\u0000e')); +print('foo\u0000f'.localeCompare('foo\u0000f')); +print('foo\u0000f'.localeCompare('foo\u0000g')); - print(''.localeCompare('\u0000')); - print('\u0000'.localeCompare('')); -} catch (e) { - print(e); -} +print(''.localeCompare('\u0000')); +print('\u0000'.localeCompare('')); diff --git a/tests/ecmascript/test-bug-lt-nul.js b/tests/ecmascript/test-bug-lt-nul.js index c70e6f3a..e5c40736 100644 --- a/tests/ecmascript/test-bug-lt-nul.js +++ b/tests/ecmascript/test-bug-lt-nul.js @@ -11,14 +11,10 @@ false * strncmp(), which stops comparing at NULs, was used. */ -try { - print('foo\u0000f' < 'foo\u0000e'); - print('foo\u0000f' < 'foo\u0000f'); - print('foo\u0000f' < 'foo\u0000g'); +print('foo\u0000f' < 'foo\u0000e'); +print('foo\u0000f' < 'foo\u0000f'); +print('foo\u0000f' < 'foo\u0000g'); - print('' < ''); - print('' < '\u0000'); - print('\u0000' < ''); -} catch (e) { - print(e); -} +print('' < ''); +print('' < '\u0000'); +print('\u0000' < ''); diff --git a/tests/ecmascript/test-bug-mingw-math-issues.js b/tests/ecmascript/test-bug-mingw-math-issues.js index 469ed975..687cbfa3 100644 --- a/tests/ecmascript/test-bug-mingw-math-issues.js +++ b/tests/ecmascript/test-bug-mingw-math-issues.js @@ -68,8 +68,4 @@ function test() { printExact(Math.pow(0/0, -0)); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-modloaded-cache-inherit.js b/tests/ecmascript/test-bug-modloaded-cache-inherit.js index c162de3e..8cf90a57 100644 --- a/tests/ecmascript/test-bug-modloaded-cache-inherit.js +++ b/tests/ecmascript/test-bug-modloaded-cache-inherit.js @@ -4,6 +4,10 @@ * trying to load a module. */ +/*--- +custom: true +---*/ + /*=== TypeError ===*/ diff --git a/tests/ecmascript/test-bug-nested-prop-mutate.js b/tests/ecmascript/test-bug-nested-prop-mutate.js index 496a43ba..2db71b28 100644 --- a/tests/ecmascript/test-bug-nested-prop-mutate.js +++ b/tests/ecmascript/test-bug-nested-prop-mutate.js @@ -90,12 +90,8 @@ function test5() { print(obj1.name); } -try { - test1(); - test2(); - test3(); - test4(); - test5(); -} catch (e) { - print(e.stack || e); -} +test1(); +test2(); +test3(); +test4(); +test5(); diff --git a/tests/ecmascript/test-bug-netbsd-math-pow.js b/tests/ecmascript/test-bug-netbsd-math-pow.js index 5e535a1d..83885717 100644 --- a/tests/ecmascript/test-bug-netbsd-math-pow.js +++ b/tests/ecmascript/test-bug-netbsd-math-pow.js @@ -34,8 +34,4 @@ function test() { pr(Math.pow(-0, Number.NEGATIVE_INFINITY)); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-nodejs-buffer-slice-isview.js b/tests/ecmascript/test-bug-nodejs-buffer-slice-isview.js index c8474d66..2f3155b4 100644 --- a/tests/ecmascript/test-bug-nodejs-buffer-slice-isview.js +++ b/tests/ecmascript/test-bug-nodejs-buffer-slice-isview.js @@ -14,8 +14,4 @@ function test() { print(typeof slice.length, slice.length); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-nregs-limit-gh111.js b/tests/ecmascript/test-bug-nregs-limit-gh111.js index 6a928bb0..d6602e24 100644 --- a/tests/ecmascript/test-bug-nregs-limit-gh111.js +++ b/tests/ecmascript/test-bug-nregs-limit-gh111.js @@ -3,9 +3,7 @@ */ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== diff --git a/tests/ecmascript/test-bug-numconv-1e23.js b/tests/ecmascript/test-bug-numconv-1e23.js index d53dd78f..0cc2f25f 100644 --- a/tests/ecmascript/test-bug-numconv-1e23.js +++ b/tests/ecmascript/test-bug-numconv-1e23.js @@ -38,10 +38,6 @@ * exactly halfway and we should round to even. */ -try { - print(parseInt('0000100000000000000000000000', 10)); - print(parseFloat('1e23', 10)); - print(parseFloat('1e+23', 10)); -} catch (e) { - print(e); -} +print(parseInt('0000100000000000000000000000', 10)); +print(parseFloat('1e23', 10)); +print(parseFloat('1e+23', 10)); diff --git a/tests/ecmascript/test-bug-numconv-denorm-toprec.js b/tests/ecmascript/test-bug-numconv-denorm-toprec.js index 3964cc12..81b8410f 100644 --- a/tests/ecmascript/test-bug-numconv-denorm-toprec.js +++ b/tests/ecmascript/test-bug-numconv-denorm-toprec.js @@ -17,9 +17,5 @@ * This bug will be fixed by proper fixed format Dragon4 changes. */ -try { - print((0.9881312916824930884e-323).toString()); - print((0.9881312916824930884e-323).toPrecision(20)); -} catch (e) { - print(e); -} +print((0.9881312916824930884e-323).toString()); +print((0.9881312916824930884e-323).toPrecision(20)); diff --git a/tests/ecmascript/test-bug-numconv-expxflow.js b/tests/ecmascript/test-bug-numconv-expxflow.js index 5af70cdd..2f64a86f 100644 --- a/tests/ecmascript/test-bug-numconv-expxflow.js +++ b/tests/ecmascript/test-bug-numconv-expxflow.js @@ -22,8 +22,4 @@ function expOverflowUnderflowTest() { print(val); } -try { - expOverflowUnderflowTest(); -} catch (e) { - print(e); -} +expOverflowUnderflowTest(); diff --git a/tests/ecmascript/test-bug-numconv-mantissa-assert.js b/tests/ecmascript/test-bug-numconv-mantissa-assert.js index f0af1f5d..7e96b7ea 100644 --- a/tests/ecmascript/test-bug-numconv-mantissa-assert.js +++ b/tests/ecmascript/test-bug-numconv-mantissa-assert.js @@ -10,8 +10,4 @@ 7.555786372591432e+22 ===*/ -try { - print(75557863725914323419136); -} catch (e) { - print(e); -} +print(75557863725914323419136); diff --git a/tests/ecmascript/test-bug-object-binding-proxy.js b/tests/ecmascript/test-bug-object-binding-proxy.js index 5b64f470..dd19bca6 100644 --- a/tests/ecmascript/test-bug-object-binding-proxy.js +++ b/tests/ecmascript/test-bug-object-binding-proxy.js @@ -48,8 +48,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-object-defprop-eidx-1.js b/tests/ecmascript/test-bug-object-defprop-eidx-1.js index 55bb6060..46398215 100644 --- a/tests/ecmascript/test-bug-object-defprop-eidx-1.js +++ b/tests/ecmascript/test-bug-object-defprop-eidx-1.js @@ -8,6 +8,10 @@ * https://github.com/svaarala/duktape/pull/1096 */ +/*--- +custom: true +---*/ + /*=== Object.defineProperty() to convert .prop to a data property finalizer, modify object @@ -48,8 +52,4 @@ function accessorToDataTest() { print(Duktape.enc('jx', obj)); } -try { - accessorToDataTest(); -} catch (e) { - print(e.stack || e); -} +accessorToDataTest(); diff --git a/tests/ecmascript/test-bug-object-defprop-eidx-2.js b/tests/ecmascript/test-bug-object-defprop-eidx-2.js index 0fc19f8a..7b4c4d64 100644 --- a/tests/ecmascript/test-bug-object-defprop-eidx-2.js +++ b/tests/ecmascript/test-bug-object-defprop-eidx-2.js @@ -10,6 +10,10 @@ * https://github.com/svaarala/duktape/pull/1096 */ +/*--- +custom: true +---*/ + /*=== Object.defineProperty() to convert .prop to an accessor property finalizer, modify object @@ -49,8 +53,4 @@ function accessorToDataTest() { print(Duktape.enc('jx', obj)); } -try { - accessorToDataTest(); -} catch (e) { - print(e.stack || e); -} +accessorToDataTest(); diff --git a/tests/ecmascript/test-bug-object-delprop-eidx-1.js b/tests/ecmascript/test-bug-object-delprop-eidx-1.js index a48882f0..040d0e96 100644 --- a/tests/ecmascript/test-bug-object-delprop-eidx-1.js +++ b/tests/ecmascript/test-bug-object-delprop-eidx-1.js @@ -4,6 +4,10 @@ * https://github.com/svaarala/duktape/pull/1096 */ +/*--- +custom: true +---*/ + /*=== deleting obj.prop finalizer, modify object @@ -50,8 +54,4 @@ function test() { print(Duktape.enc('jx', obj)); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-object-literal-getset-tempreg.js b/tests/ecmascript/test-bug-object-literal-getset-tempreg.js index 58b13e5b..5cb9b674 100644 --- a/tests/ecmascript/test-bug-object-literal-getset-tempreg.js +++ b/tests/ecmascript/test-bug-object-literal-getset-tempreg.js @@ -1,5 +1,9 @@ // Reported here: https://github.com/svaarala/duktape/pull/1190#issuecomment-267533606 +/*--- +custom: true +---*/ + /*=== still here function true true true diff --git a/tests/ecmascript/test-bug-object-prop-alloc-unbounded.js b/tests/ecmascript/test-bug-object-prop-alloc-unbounded.js index af87cffa..fca600c7 100644 --- a/tests/ecmascript/test-bug-object-prop-alloc-unbounded.js +++ b/tests/ecmascript/test-bug-object-prop-alloc-unbounded.js @@ -36,6 +36,10 @@ /*@include util-object.js@*/ +/*--- +custom: true +---*/ + /*=== without compaction entry count < 100: true @@ -84,11 +88,7 @@ function objectEntryPartResizeTest(doCompact) { print('entry count < 100:', (entrySize < 100)); } -try { - print('without compaction'); - objectEntryPartResizeTest(false); - print('with compaction'); - objectEntryPartResizeTest(true); -} catch (e) { - print(e); -} +print('without compaction'); +objectEntryPartResizeTest(false); +print('with compaction'); +objectEntryPartResizeTest(true); diff --git a/tests/ecmascript/test-bug-object-proto-protected-1.js b/tests/ecmascript/test-bug-object-proto-protected-1.js index ac1806fa..43a678ac 100644 --- a/tests/ecmascript/test-bug-object-proto-protected-1.js +++ b/tests/ecmascript/test-bug-object-proto-protected-1.js @@ -44,8 +44,4 @@ function test() { print(obj.prop1, obj.prop2); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-oom-nested-error-gh2278.js b/tests/ecmascript/test-bug-oom-nested-error-gh2278.js index d188b1eb..ade02fdd 100644 --- a/tests/ecmascript/test-bug-oom-nested-error-gh2278.js +++ b/tests/ecmascript/test-bug-oom-nested-error-gh2278.js @@ -18,8 +18,5 @@ function test() { obj = { ref1: obj, ref2: obj }; } } -try { - test(); -} catch (e) { - print(e); -} + +test(); diff --git a/tests/ecmascript/test-bug-packed-tval-nan-normalize.js b/tests/ecmascript/test-bug-packed-tval-nan-normalize.js index f1400609..8479d150 100644 --- a/tests/ecmascript/test-bug-packed-tval-nan-normalize.js +++ b/tests/ecmascript/test-bug-packed-tval-nan-normalize.js @@ -1,19 +1,10 @@ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== NaN -done ===*/ -try { - var val = CBOR.decode(new Uint8Array([ 0xfb, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ])); - print(val); -} catch (e) { - print(e.stack || e); -} - -print('done'); +var val = CBOR.decode(new Uint8Array([ 0xfb, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 ])); +print(val); diff --git a/tests/ecmascript/test-bug-parseint-radix16-leadingzero-gh413.js b/tests/ecmascript/test-bug-parseint-radix16-leadingzero-gh413.js index dca9589b..a4580607 100644 --- a/tests/ecmascript/test-bug-parseint-radix16-leadingzero-gh413.js +++ b/tests/ecmascript/test-bug-parseint-radix16-leadingzero-gh413.js @@ -30,8 +30,4 @@ function test() { print(parseInt('0X1234', 16)); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-plus-coercion-gh2019.js b/tests/ecmascript/test-bug-plus-coercion-gh2019.js index 4626b9c7..5caa7ac1 100644 --- a/tests/ecmascript/test-bug-plus-coercion-gh2019.js +++ b/tests/ecmascript/test-bug-plus-coercion-gh2019.js @@ -31,43 +31,36 @@ NaN 0 Infinity 0 -done ===*/ -try { - print(+'+'); - print(+'-'); - print(+'+0'); - print(1 / +'+0'); - print(+'-0'); - print(1 / +'-0'); - print(+''); +print(+'+'); +print(+'-'); +print(+'+0'); +print(1 / +'+0'); +print(+'-0'); +print(1 / +'-0'); +print(+''); - print(+' + '); - print(+' - '); - print(+' +0 '); - print(1 / +' +0 '); - print(+' -0 '); - print(1 / +' -0 '); - print(+' '); +print(+' + '); +print(+' - '); +print(+' +0 '); +print(1 / +' +0 '); +print(+' -0 '); +print(1 / +' -0 '); +print(+' '); - print(-'+'); - print(-'-'); - print(-'+0'); - print(1 / -'+0'); - print(-'-0'); - print(1 / -'-0'); - print(-''); +print(-'+'); +print(-'-'); +print(-'+0'); +print(1 / -'+0'); +print(-'-0'); +print(1 / -'-0'); +print(-''); - print(-' + '); - print(-' - '); - print(-' +0 '); - print(1 / -' +0 '); - print(-' -0 '); - print(1 / -' -0 '); - print(-' '); -} catch (e) { - print(e.stack || e); -} - -print('done'); +print(-' + '); +print(-' - '); +print(-' +0 '); +print(1 / -' +0 '); +print(-' -0 '); +print(1 / -' -0 '); +print(-' '); diff --git a/tests/ecmascript/test-bug-prop-set-get-default-value.js b/tests/ecmascript/test-bug-prop-set-get-default-value.js index 4467b697..48cba3b8 100644 --- a/tests/ecmascript/test-bug-prop-set-get-default-value.js +++ b/tests/ecmascript/test-bug-prop-set-get-default-value.js @@ -47,8 +47,4 @@ function test() { printDesc('prop2'); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-propread-mutate.js b/tests/ecmascript/test-bug-propread-mutate.js index 4187e870..3b530fa6 100644 --- a/tests/ecmascript/test-bug-propread-mutate.js +++ b/tests/ecmascript/test-bug-propread-mutate.js @@ -23,8 +23,4 @@ function test() { print(obj1[(obj1 = obj2), 'name']); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-props-asize-gh2023-2.js b/tests/ecmascript/test-bug-props-asize-gh2023-2.js index d29f106a..3e16e7d1 100644 --- a/tests/ecmascript/test-bug-props-asize-gh2023-2.js +++ b/tests/ecmascript/test-bug-props-asize-gh2023-2.js @@ -5,11 +5,8 @@ */ /*=== -done ===*/ var input = []; input[65536] = 0; var output = input.map(Math.cos); - -print('done'); diff --git a/tests/ecmascript/test-bug-props-asize-gh2023.js b/tests/ecmascript/test-bug-props-asize-gh2023.js index bf6794d5..1daa9d47 100644 --- a/tests/ecmascript/test-bug-props-asize-gh2023.js +++ b/tests/ecmascript/test-bug-props-asize-gh2023.js @@ -3,7 +3,6 @@ */ /*=== -done ===*/ function mapchar ( v ) { } @@ -12,5 +11,3 @@ var round ; input = [ ] ; input[ 65536 ] = 0 ; input.map( mapchar ).join( '' ); - -print('done'); diff --git a/tests/ecmascript/test-bug-proxy-bound-assert-gh2049.js b/tests/ecmascript/test-bug-proxy-bound-assert-gh2049.js index 58054eec..518683a6 100644 --- a/tests/ecmascript/test-bug-proxy-bound-assert-gh2049.js +++ b/tests/ecmascript/test-bug-proxy-bound-assert-gh2049.js @@ -36,9 +36,3 @@ try { } catch (e) { print(e.stack || e); } - -/*=== -done -===*/ - -print('done'); diff --git a/tests/ecmascript/test-bug-proxy-finalizer-double-call.js b/tests/ecmascript/test-bug-proxy-finalizer-double-call.js index 745efb14..75338e3e 100644 --- a/tests/ecmascript/test-bug-proxy-finalizer-double-call.js +++ b/tests/ecmascript/test-bug-proxy-finalizer-double-call.js @@ -7,6 +7,10 @@ * See: https://github.com/svaarala/duktape/issues/45 */ +/*--- +custom: true +---*/ + /*=== about to exit finalize [object Object] diff --git a/tests/ecmascript/test-bug-proxy-ownkeys-arridx-inherit-gh2207.js b/tests/ecmascript/test-bug-proxy-ownkeys-arridx-inherit-gh2207.js index d0cbb3d1..05876844 100644 --- a/tests/ecmascript/test-bug-proxy-ownkeys-arridx-inherit-gh2207.js +++ b/tests/ecmascript/test-bug-proxy-ownkeys-arridx-inherit-gh2207.js @@ -2,7 +2,6 @@ /*=== {"foo":0,"nonEnumerable":0} -done ===*/ Object.defineProperty(Array.prototype, 0, { set: function () { } }); @@ -14,4 +13,3 @@ function jsonStringifyOwnKeysProxyTest () { } jsonStringifyOwnKeysProxyTest(); -print('done'); diff --git a/tests/ecmascript/test-bug-putvar-ptrstab-proxywith-gh2323.js b/tests/ecmascript/test-bug-putvar-ptrstab-proxywith-gh2323.js index 3ce80407..5df9dd67 100644 --- a/tests/ecmascript/test-bug-putvar-ptrstab-proxywith-gh2323.js +++ b/tests/ecmascript/test-bug-putvar-ptrstab-proxywith-gh2323.js @@ -1,5 +1,4 @@ /*=== -done ===*/ function main() { @@ -12,9 +11,5 @@ function main() { var v9 = 0; } } -try { - main(); -} catch (e) { - print(e.stack || e); -} -print('done'); + +main(); diff --git a/tests/ecmascript/test-bug-recursive-voluntary-markandsweep.js b/tests/ecmascript/test-bug-recursive-voluntary-markandsweep.js index 388ef5cf..c73ec9dc 100644 --- a/tests/ecmascript/test-bug-recursive-voluntary-markandsweep.js +++ b/tests/ecmascript/test-bug-recursive-voluntary-markandsweep.js @@ -3,6 +3,10 @@ * voluntary GC, https://github.com/svaarala/duktape/pull/1347. */ +/*--- +custom: true +---*/ + /*=== 0 1 @@ -14,7 +18,6 @@ 7 8 9 -done ===*/ function myFinalizer(obj) { @@ -58,12 +61,6 @@ function test() { Duktape.gc(); Duktape.gc(); } - - print('done'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-reduce-judofyr.js b/tests/ecmascript/test-bug-reduce-judofyr.js index 43dc61c2..672e36a1 100644 --- a/tests/ecmascript/test-bug-reduce-judofyr.js +++ b/tests/ecmascript/test-bug-reduce-judofyr.js @@ -23,33 +23,29 @@ undefined [1,2,3,4] ===*/ -try { - var reduce = function(obj, iterator, memo) { - return obj.reduce(iterator, memo); - }; +var reduce = function(obj, iterator, memo) { + return obj.reduce(iterator, memo); +}; - var flatten = function(array, shallow) { - /* The problem here with a tailcall is that the flatten() invocation will - * be replaced in the callstack without an explicit unwind. The GETVAR - * for 'shallow' will still match to the outer lexical environment but the - * environment will not be closed. - * - * As a result, the 'shallow' lookup will look up an unrelated register and - * return the incorrect 'function' value. The fix is to ensure that the - * current activation is closed on a TAILCALL. - */ - return reduce(array, function(memo, value) { - if (Array.isArray(value)) { - print(shallow); // this should print undef - return memo.concat(shallow ? value : flatten(value)); - } else { - memo[memo.length] = value; - } - return memo; - }, []); - } - - print(JSON.stringify(flatten([1, [2], [3, [[[4]]]]]))); // [1,2,3,4] -} catch (e) { - print(e) +var flatten = function(array, shallow) { + /* The problem here with a tailcall is that the flatten() invocation will + * be replaced in the callstack without an explicit unwind. The GETVAR + * for 'shallow' will still match to the outer lexical environment but the + * environment will not be closed. + * + * As a result, the 'shallow' lookup will look up an unrelated register and + * return the incorrect 'function' value. The fix is to ensure that the + * current activation is closed on a TAILCALL. + */ + return reduce(array, function(memo, value) { + if (Array.isArray(value)) { + print(shallow); // this should print undef + return memo.concat(shallow ? value : flatten(value)); + } else { + memo[memo.length] = value; + } + return memo; + }, []); } + +print(JSON.stringify(flatten([1, [2], [3, [[[4]]]]]))); // [1,2,3,4] diff --git a/tests/ecmascript/test-bug-refcount-finalizer-garbage-loop.js b/tests/ecmascript/test-bug-refcount-finalizer-garbage-loop.js index 95b6d8d2..0d96b391 100644 --- a/tests/ecmascript/test-bug-refcount-finalizer-garbage-loop.js +++ b/tests/ecmascript/test-bug-refcount-finalizer-garbage-loop.js @@ -28,6 +28,10 @@ * is then made with up-to-date refcounts. */ +/*--- +custom: true +---*/ + /*=== no finalizer caught Error: thrown by constructor diff --git a/tests/ecmascript/test-bug-regexp-class-dash.js b/tests/ecmascript/test-bug-regexp-class-dash.js index 00e3e987..0818ebe3 100644 --- a/tests/ecmascript/test-bug-regexp-class-dash.js +++ b/tests/ecmascript/test-bug-regexp-class-dash.js @@ -23,8 +23,4 @@ function test() { print(re.test('-')); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-regexp-class-zeroesc.js b/tests/ecmascript/test-bug-regexp-class-zeroesc.js index 0d13e45b..de87a5ce 100644 --- a/tests/ecmascript/test-bug-regexp-class-zeroesc.js +++ b/tests/ecmascript/test-bug-regexp-class-zeroesc.js @@ -15,8 +15,4 @@ function test() { print(re2.test('\u0000')); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-regexp-comp-reclimit.js b/tests/ecmascript/test-bug-regexp-comp-reclimit.js index 34a85152..1e6affc3 100644 --- a/tests/ecmascript/test-bug-regexp-comp-reclimit.js +++ b/tests/ecmascript/test-bug-regexp-comp-reclimit.js @@ -6,17 +6,13 @@ compiled ok * decremented. Hence a sequence of disjunctions, while having a low maximum * recursion depth, will trigger the recursion limit. */ -try { - var t, i; - var r; +var t, i; +var r; - t = '^'; - for (i = 0; i < 100; i++) { - t = t + '(?:a|b)'; - } - - r = new RegExp(t); - print('compiled ok'); -} catch (e) { - print(e.name); +t = '^'; +for (i = 0; i < 100; i++) { + t = t + '(?:a|b)'; } + +r = new RegExp(t); +print('compiled ok'); diff --git a/tests/ecmascript/test-bug-regexp-dash-assert.js b/tests/ecmascript/test-bug-regexp-dash-assert.js index 82240a4d..b917f1b8 100644 --- a/tests/ecmascript/test-bug-regexp-dash-assert.js +++ b/tests/ecmascript/test-bug-regexp-dash-assert.js @@ -7,8 +7,4 @@ function test() { print(re.test('-')); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-regexp-nonmatching-noncapturing-group.js b/tests/ecmascript/test-bug-regexp-nonmatching-noncapturing-group.js index 8c7f82f2..1ef8265a 100644 --- a/tests/ecmascript/test-bug-regexp-nonmatching-noncapturing-group.js +++ b/tests/ecmascript/test-bug-regexp-nonmatching-noncapturing-group.js @@ -43,8 +43,4 @@ function regexpNoncapturingTest() { print(/(?:a)?/.test("a")); } -try { - regexpNoncapturingTest(); -} catch (e) { - print(e); -} +regexpNoncapturingTest(); diff --git a/tests/ecmascript/test-bug-regexp-postincr.js b/tests/ecmascript/test-bug-regexp-postincr.js index 31966121..43b52a6f 100644 --- a/tests/ecmascript/test-bug-regexp-postincr.js +++ b/tests/ecmascript/test-bug-regexp-postincr.js @@ -16,37 +16,31 @@ 0.5 SyntaxError /foo/ -done ===*/ -try { - // Original issue found in the wild. - print(eval('z = 0; [67,69,71][0|z++/20]')); +// Original issue found in the wild. +print(eval('z = 0; [67,69,71][0|z++/20]')); - // Coverage for similar issues. - print(eval('z = 100; z++/20')); - print(eval('z = 100; z--/20')); - print(eval('z = 100; ++z/20')); - print(eval('z = 100; --z/20')); +// Coverage for similar issues. +print(eval('z = 100; z++/20')); +print(eval('z = 100; z--/20')); +print(eval('z = 100; ++z/20')); +print(eval('z = 100; --z/20')); - // Other related tests. - print(eval('x = 100; y = 200; z = 300; w = 400; x++/y++/z++/w++;')); - print(eval('x = 100; y = 200; z = 300; w = 400; x--/y--/z--/w--;')); - print(eval('x = 100; y = 200; z = 300; w = 400; ++x/++y/++z/++w;')); - print(eval('x = 100; y = 200; z = 300; w = 400; --x/--y/--z/--w;')); - print(eval('x = 100; y = 200; z = 300; w = 400; x++/y--/++z/--w;')); - print(eval('x = 100; y = 200; x++/y;')); - try { - print(String(eval('x = 100; y = 200; x++\n/foo/'))); - } catch (e) { - print(e.name); - } - try { - print(String(eval('x = 100; y = 200; x++;\n/foo/'))); - } catch (e) { - print(e.name); - } +// Other related tests. +print(eval('x = 100; y = 200; z = 300; w = 400; x++/y++/z++/w++;')); +print(eval('x = 100; y = 200; z = 300; w = 400; x--/y--/z--/w--;')); +print(eval('x = 100; y = 200; z = 300; w = 400; ++x/++y/++z/++w;')); +print(eval('x = 100; y = 200; z = 300; w = 400; --x/--y/--z/--w;')); +print(eval('x = 100; y = 200; z = 300; w = 400; x++/y--/++z/--w;')); +print(eval('x = 100; y = 200; x++/y;')); +try { + print(String(eval('x = 100; y = 200; x++\n/foo/'))); +} catch (e) { + print(e.name); +} +try { + print(String(eval('x = 100; y = 200; x++;\n/foo/'))); } catch (e) { - print(e.stack || e); + print(e.name); } -print('done'); diff --git a/tests/ecmascript/test-bug-regexp-quantifier-captures.js b/tests/ecmascript/test-bug-regexp-quantifier-captures.js index c80c3e26..98ecbe7e 100644 --- a/tests/ecmascript/test-bug-regexp-quantifier-captures.js +++ b/tests/ecmascript/test-bug-regexp-quantifier-captures.js @@ -74,8 +74,4 @@ function regexpQuantifierCaptureTest() { } } -try { - regexpQuantifierCaptureTest(); -} catch (e) { - print(e); -} +regexpQuantifierCaptureTest(); diff --git a/tests/ecmascript/test-bug-rejected-delete-property.js b/tests/ecmascript/test-bug-rejected-delete-property.js index 00a1f92e..9eb0abfb 100644 --- a/tests/ecmascript/test-bug-rejected-delete-property.js +++ b/tests/ecmascript/test-bug-rejected-delete-property.js @@ -21,8 +21,4 @@ function test() { print(delete str[1]); } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-bug-ret-call.js b/tests/ecmascript/test-bug-ret-call.js index c9089886..95303b2c 100644 --- a/tests/ecmascript/test-bug-ret-call.js +++ b/tests/ecmascript/test-bug-ret-call.js @@ -10,8 +10,4 @@ function f(x) { return String.fromCharCode(x); } -try { - print(f(65)); -} catch (e) { - print(e.name); -} +print(f(65)); diff --git a/tests/ecmascript/test-bug-shuffle-gh115.js b/tests/ecmascript/test-bug-shuffle-gh115.js index 364d8b39..7d03e060 100644 --- a/tests/ecmascript/test-bug-shuffle-gh115.js +++ b/tests/ecmascript/test-bug-shuffle-gh115.js @@ -21,7 +21,6 @@ test 1 test 2 test 3 -done ===*/ function genfunc(nvar, nconst, gencsprop, avoidmputobj) { @@ -106,12 +105,6 @@ function test() { } } } - - print('done'); } -try { - test('foo'); -} catch (e) { - print(e.stack || e); -} +test('foo'); diff --git a/tests/ecmascript/test-bug-strcomp.js b/tests/ecmascript/test-bug-strcomp.js index 960e041b..3b6135fc 100644 --- a/tests/ecmascript/test-bug-strcomp.js +++ b/tests/ecmascript/test-bug-strcomp.js @@ -4,10 +4,6 @@ false true ===*/ -try { - print('' === 'foo'); - print('' > 'foo'); - print('' < 'foo'); -} catch (e) { - print(e); -} +print('' === 'foo'); +print('' > 'foo'); +print('' < 'foo'); diff --git a/tests/ecmascript/test-bug-strict-global-this.js b/tests/ecmascript/test-bug-strict-global-this.js index 1920f121..3a6c361f 100644 --- a/tests/ecmascript/test-bug-strict-global-this.js +++ b/tests/ecmascript/test-bug-strict-global-this.js @@ -10,8 +10,4 @@ object ===*/ -try { - print(typeof this); -} catch (e) { - print(e); -} +print(typeof this); diff --git a/tests/ecmascript/test-bug-string-arridx-overflow.js b/tests/ecmascript/test-bug-string-arridx-overflow.js index bc8652dc..7d88dbae 100644 --- a/tests/ecmascript/test-bug-string-arridx-overflow.js +++ b/tests/ecmascript/test-bug-string-arridx-overflow.js @@ -13,8 +13,4 @@ function test() { print(arr.length); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-string-endswith-memcmp-overflow.js b/tests/ecmascript/test-bug-string-endswith-memcmp-overflow.js index e5344d67..3256b703 100644 --- a/tests/ecmascript/test-bug-string-endswith-memcmp-overflow.js +++ b/tests/ecmascript/test-bug-string-endswith-memcmp-overflow.js @@ -1,11 +1,5 @@ /*=== -done ===*/ -try { - var v3 = "c".repeat(536870912); - var v4 = "base64".endsWith(v3); -} catch (e) { - print(e.stack || e); -} -print('done'); +var v3 = "c".repeat(536870912); +var v4 = "base64".endsWith(v3); diff --git a/tests/ecmascript/test-bug-string-replace-assert-gh492.js b/tests/ecmascript/test-bug-string-replace-assert-gh492.js index 61b00382..dfc1dbf7 100644 --- a/tests/ecmascript/test-bug-string-replace-assert-gh492.js +++ b/tests/ecmascript/test-bug-string-replace-assert-gh492.js @@ -38,8 +38,4 @@ function test() { print('still here'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-string-replace-empty-match.js b/tests/ecmascript/test-bug-string-replace-empty-match.js index 31e07ea1..baccd8d8 100644 --- a/tests/ecmascript/test-bug-string-replace-empty-match.js +++ b/tests/ecmascript/test-bug-string-replace-empty-match.js @@ -5,10 +5,6 @@ foo /* Empty match with a global RegExp caused an infinite loop. */ -try { - var t = 'foo'.replace(/(?:)/g, ''); - print('finished'); - print(t); -} catch (e) { - print(e); -} +var t = 'foo'.replace(/(?:)/g, ''); +print('finished'); +print(t); diff --git a/tests/ecmascript/test-bug-string-replace-ptr-handling-1.js b/tests/ecmascript/test-bug-string-replace-ptr-handling-1.js index 50960cb1..ae178859 100644 --- a/tests/ecmascript/test-bug-string-replace-ptr-handling-1.js +++ b/tests/ecmascript/test-bug-string-replace-ptr-handling-1.js @@ -5,7 +5,6 @@ /*=== 443016350 7 -done ===*/ function main() { @@ -14,9 +13,5 @@ function main() { var v3 = "EPSILON".replace(v2); print(v3.length); } -try { - main(); -} catch (e) { - print(e.stack || e); -} -print('done'); + +main(); diff --git a/tests/ecmascript/test-bug-string-replace-undefined-cap.js b/tests/ecmascript/test-bug-string-replace-undefined-cap.js index 143faf5b..e44f4d60 100644 --- a/tests/ecmascript/test-bug-string-replace-undefined-cap.js +++ b/tests/ecmascript/test-bug-string-replace-undefined-cap.js @@ -9,16 +9,12 @@ f /* Undefined captures were not skipped correctly. */ -try { - print('foo'.replace(/(o)|(o)/, '$1')); - print('foo'.replace(/(o)|(o)/, '$01')); +print('foo'.replace(/(o)|(o)/, '$1')); +print('foo'.replace(/(o)|(o)/, '$01')); - // capture 2 not found, matching string should be replaced with empty; - // with the bug, the first one would print "f2o". - print('foo'.replace(/(o)|(o)/, '$2')); - print('foo'.replace(/(o)|(o)/, '$02')); - print('foo'.replace(/(o)|(o)/g, '$2')); - print('foo'.replace(/(o)|(o)/g, '$02')); -} catch (e) { - print(e); -} +// capture 2 not found, matching string should be replaced with empty; +// with the bug, the first one would print "f2o". +print('foo'.replace(/(o)|(o)/, '$2')); +print('foo'.replace(/(o)|(o)/, '$02')); +print('foo'.replace(/(o)|(o)/g, '$2')); +print('foo'.replace(/(o)|(o)/g, '$02')); diff --git a/tests/ecmascript/test-bug-stringtable-leak.js b/tests/ecmascript/test-bug-stringtable-leak.js index 23952f7f..85b83e18 100644 --- a/tests/ecmascript/test-bug-stringtable-leak.js +++ b/tests/ecmascript/test-bug-stringtable-leak.js @@ -19,10 +19,8 @@ */ /*--- -{ - "custom": true, - "slow": true -} +custom: true +slow: true ---*/ /*=== @@ -95,14 +93,5 @@ function test2() { } } -try { - test1(); -} catch (e) { - print(e); -} - -try { - test2(); -} catch (e) { - print(e); -} +test1(); +test2(); diff --git a/tests/ecmascript/test-bug-switch-default-first.js b/tests/ecmascript/test-bug-switch-default-first.js index 5f6ba60d..8778caf1 100644 --- a/tests/ecmascript/test-bug-switch-default-first.js +++ b/tests/ecmascript/test-bug-switch-default-first.js @@ -50,18 +50,14 @@ function test3(v) { } } -try { - print(test1(0)); - print(test1(1)); - print(test1(2)); +print(test1(0)); +print(test1(1)); +print(test1(2)); - print(test2(0)); - print(test2(1)); - print(test2(2)); +print(test2(0)); +print(test2(1)); +print(test2(2)); - print(test3(0)); - print(test3(1)); - print(test3(2)); -} catch (e) { - print(e.stack || e); -} +print(test3(0)); +print(test3(1)); +print(test3(2)); diff --git a/tests/ecmascript/test-bug-tailcall-in-constructor-gh1554.js b/tests/ecmascript/test-bug-tailcall-in-constructor-gh1554.js index f6c04838..f5d1e856 100644 --- a/tests/ecmascript/test-bug-tailcall-in-constructor-gh1554.js +++ b/tests/ecmascript/test-bug-tailcall-in-constructor-gh1554.js @@ -16,8 +16,4 @@ function test() { print(typeof O); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-tailcall-in-switch.js b/tests/ecmascript/test-bug-tailcall-in-switch.js index 538f925b..0205f201 100644 --- a/tests/ecmascript/test-bug-tailcall-in-switch.js +++ b/tests/ecmascript/test-bug-tailcall-in-switch.js @@ -57,20 +57,6 @@ function test3(x) { } -try { - print(test1(1)); -} catch (e) { - print(e); -} - -try { - print(test2(1)); -} catch (e) { - print(e); -} - -try { - print(test3(1)); -} catch (e) { - print(e); -} +print(test1(1)); +print(test2(1)); +print(test3(1)); diff --git a/tests/ecmascript/test-bug-tailcall-thread-yield-resume.js b/tests/ecmascript/test-bug-tailcall-thread-yield-resume.js index 4471f793..2426dd50 100644 --- a/tests/ecmascript/test-bug-tailcall-thread-yield-resume.js +++ b/tests/ecmascript/test-bug-tailcall-thread-yield-resume.js @@ -29,6 +29,10 @@ * Duktape 0.10.0 to print "never here". */ +/*--- +custom: true +---*/ + /*=== retval retval @@ -117,26 +121,7 @@ function test4() { } } -try { - print(test1()); -} catch (e) { - print(e); -} - -try { - print(test2()); -} catch (e) { - print(e); -} - -try { - test3(); -} catch (e) { - print(e); -} - -try { - test4(); -} catch (e) { - print(e); -} +print(test1()); +print(test2()); +test3(); +test4(); diff --git a/tests/ecmascript/test-bug-test262-u2028-u2029-handling.js b/tests/ecmascript/test-bug-test262-u2028-u2029-handling.js index de56ed53..ec72b708 100644 --- a/tests/ecmascript/test-bug-test262-u2028-u2029-handling.js +++ b/tests/ecmascript/test-bug-test262-u2028-u2029-handling.js @@ -12,18 +12,10 @@ var bar; -try { - bar = -1; - eval("var foo\u2028bar = 66;"); - print(bar); -} catch (e) { - print(e); -} +bar = -1; +eval("var foo\u2028bar = 66;"); +print(bar); -try { - bar = -1; - eval("var foo\u2028bar = 66;"); - print(bar); -} catch (e) { - print(e); -} +bar = -1; +eval("var foo\u2028bar = 66;"); +print(bar); diff --git a/tests/ecmascript/test-bug-throw-in-catch.js b/tests/ecmascript/test-bug-throw-in-catch.js index 5e85f183..0cc05b5b 100644 --- a/tests/ecmascript/test-bug-throw-in-catch.js +++ b/tests/ecmascript/test-bug-throw-in-catch.js @@ -6,9 +6,7 @@ */ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -22,7 +20,6 @@ resumed with quux yielded with 3 resumed with baz Error: error 2 -finished ===*/ function yielder(x) { @@ -64,5 +61,3 @@ try { } catch (e) { print(e); } - -print('finished'); diff --git a/tests/ecmascript/test-bug-tonumber-u0000.js b/tests/ecmascript/test-bug-tonumber-u0000.js index 4101f6b5..829ea900 100644 --- a/tests/ecmascript/test-bug-tonumber-u0000.js +++ b/tests/ecmascript/test-bug-tonumber-u0000.js @@ -11,9 +11,5 @@ NaN * empty string in C code, so this testcase ensures that doesn't happen. */ -try { - print(+'', 1/(+'')); - print(+'\u0000'); -} catch (e) { - print(e); -} +print(+'', 1/(+'')); +print(+'\u0000'); diff --git a/tests/ecmascript/test-bug-trycatch-many-constants.js b/tests/ecmascript/test-bug-trycatch-many-constants.js index 767edc41..6fd5d95d 100644 --- a/tests/ecmascript/test-bug-trycatch-many-constants.js +++ b/tests/ecmascript/test-bug-trycatch-many-constants.js @@ -61,8 +61,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-typedarray-set-undefined.js b/tests/ecmascript/test-bug-typedarray-set-undefined.js index 30e6e8a6..188a89aa 100644 --- a/tests/ecmascript/test-bug-typedarray-set-undefined.js +++ b/tests/ecmascript/test-bug-typedarray-set-undefined.js @@ -1,6 +1,5 @@ /*=== TypeError -still here ===*/ var x = new Float64Array(2) @@ -9,4 +8,3 @@ try { } catch (e) { print(e.name); } -print('still here'); diff --git a/tests/ecmascript/test-bug-typeof-undefined.js b/tests/ecmascript/test-bug-typeof-undefined.js index 572fcf2b..50421094 100644 --- a/tests/ecmascript/test-bug-typeof-undefined.js +++ b/tests/ecmascript/test-bug-typeof-undefined.js @@ -8,10 +8,6 @@ undefined * value.) */ -try { - var t = typeof foo; // UnresolvableReference - print(typeof t); - print(t); -} catch (e) { - print(e); -} +var t = typeof foo; // UnresolvableReference +print(typeof t); +print(t); diff --git a/tests/ecmascript/test-bug-typeof-unref.js b/tests/ecmascript/test-bug-typeof-unref.js index 546dbe6c..d9443481 100644 --- a/tests/ecmascript/test-bug-typeof-unref.js +++ b/tests/ecmascript/test-bug-typeof-unref.js @@ -8,8 +8,4 @@ undefined * This was broken at some point. */ -try { - print(typeof x); -} catch (e) { - print(e.name); -} +print(typeof x); diff --git a/tests/ecmascript/test-bug-unary-bitwise-not-inplace.js b/tests/ecmascript/test-bug-unary-bitwise-not-inplace.js index 0826b1cf..05903713 100644 --- a/tests/ecmascript/test-bug-unary-bitwise-not-inplace.js +++ b/tests/ecmascript/test-bug-unary-bitwise-not-inplace.js @@ -10,8 +10,4 @@ function test() { print(foo); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-unary-minus-inplace.js b/tests/ecmascript/test-bug-unary-minus-inplace.js index e95608dd..e71d3ab1 100644 --- a/tests/ecmascript/test-bug-unary-minus-inplace.js +++ b/tests/ecmascript/test-bug-unary-minus-inplace.js @@ -10,8 +10,4 @@ function test() { print(foo); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-unary-plus-inplace-modify.js b/tests/ecmascript/test-bug-unary-plus-inplace-modify.js index 66ddd95d..abdf9a0c 100644 --- a/tests/ecmascript/test-bug-unary-plus-inplace-modify.js +++ b/tests/ecmascript/test-bug-unary-plus-inplace-modify.js @@ -10,8 +10,4 @@ function test() { print(foo); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-unwind-gh2021.js b/tests/ecmascript/test-bug-unwind-gh2021.js index f6f3fe0e..81c73b8a 100644 --- a/tests/ecmascript/test-bug-unwind-gh2021.js +++ b/tests/ecmascript/test-bug-unwind-gh2021.js @@ -4,7 +4,6 @@ /*=== error -done ===*/ function basicTest() { @@ -24,5 +23,3 @@ try { // call stack. print('error'); } - -print('done'); diff --git a/tests/ecmascript/test-bug-utf8-varname.js b/tests/ecmascript/test-bug-utf8-varname.js index 5005c4ba..8a6b1e1b 100644 --- a/tests/ecmascript/test-bug-utf8-varname.js +++ b/tests/ecmascript/test-bug-utf8-varname.js @@ -12,8 +12,4 @@ function test() { print('count:', my_变量); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-bug-valgrind-tonumber-1.js b/tests/ecmascript/test-bug-valgrind-tonumber-1.js index 27f4ebb5..f5228266 100644 --- a/tests/ecmascript/test-bug-valgrind-tonumber-1.js +++ b/tests/ecmascript/test-bug-valgrind-tonumber-1.js @@ -18,10 +18,8 @@ */ /*=== -still here ===*/ var x; x = "NaN" >>> 0; -print('still here'); diff --git a/tests/ecmascript/test-bug-valstack-assert-gh2024.js b/tests/ecmascript/test-bug-valstack-assert-gh2024.js index 18c3eaf1..a5e3a519 100644 --- a/tests/ecmascript/test-bug-valstack-assert-gh2024.js +++ b/tests/ecmascript/test-bug-valstack-assert-gh2024.js @@ -6,7 +6,6 @@ */ /*=== -done ===*/ function test ( ) { @@ -21,4 +20,3 @@ function test ( ) { func = function ( a , b , c ) { print ( eval ( '"aiee"' ) ) ; } ; } try { test ( ) ; } catch ( e ) { /* print(e); */ } -print('done'); diff --git a/tests/ecmascript/test-bug-valstack-assert-gh2032.js b/tests/ecmascript/test-bug-valstack-assert-gh2032.js index 2fc84ac2..93a70c13 100644 --- a/tests/ecmascript/test-bug-valstack-assert-gh2032.js +++ b/tests/ecmascript/test-bug-valstack-assert-gh2032.js @@ -4,7 +4,6 @@ /*=== RangeError -done ===*/ try { @@ -37,5 +36,3 @@ try { } catch (e) { print(e.name); } - -print('done'); diff --git a/tests/ecmascript/test-bug-with-strict-mode.js b/tests/ecmascript/test-bug-with-strict-mode.js index 396e9a2d..cfdc9ce0 100644 --- a/tests/ecmascript/test-bug-with-strict-mode.js +++ b/tests/ecmascript/test-bug-with-strict-mode.js @@ -20,8 +20,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-enum-proxy-inherit.js b/tests/ecmascript/test-enum-proxy-inherit.js index c374e8f8..0b3770a3 100644 --- a/tests/ecmascript/test-enum-proxy-inherit.js +++ b/tests/ecmascript/test-enum-proxy-inherit.js @@ -25,8 +25,4 @@ function test() { print('done'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-err-callstack-headroom-1.js b/tests/ecmascript/test-err-callstack-headroom-1.js index 9fd81a1e..b76abb35 100644 --- a/tests/ecmascript/test-err-callstack-headroom-1.js +++ b/tests/ecmascript/test-err-callstack-headroom-1.js @@ -9,9 +9,7 @@ */ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== diff --git a/tests/ecmascript/test-err-callstack-headroom-2.js b/tests/ecmascript/test-err-callstack-headroom-2.js index 5456e9b1..19f6e0d0 100644 --- a/tests/ecmascript/test-err-callstack-headroom-2.js +++ b/tests/ecmascript/test-err-callstack-headroom-2.js @@ -7,9 +7,7 @@ */ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== diff --git a/tests/ecmascript/test-err-errcreate-error.js b/tests/ecmascript/test-err-errcreate-error.js index 5dc66b04..42be7867 100644 --- a/tests/ecmascript/test-err-errcreate-error.js +++ b/tests/ecmascript/test-err-errcreate-error.js @@ -3,6 +3,10 @@ * normally except they won't be augmented to avoid recursion. */ +/*--- +custom: true +---*/ + /*=== errCreate: RangeError internal error: URIError diff --git a/tests/ecmascript/test-err-errthrow-error.js b/tests/ecmascript/test-err-errthrow-error.js index dda34504..d75532f8 100644 --- a/tests/ecmascript/test-err-errthrow-error.js +++ b/tests/ecmascript/test-err-errthrow-error.js @@ -3,6 +3,10 @@ * normally except they won't be augmented to avoid recursion. */ +/*--- +custom: true +---*/ + /*=== errCreate: RangeError errThrow: RangeError diff --git a/tests/ecmascript/test-example.js b/tests/ecmascript/test-example.js index e2c49103..022743f4 100644 --- a/tests/ecmascript/test-example.js +++ b/tests/ecmascript/test-example.js @@ -2,15 +2,13 @@ * Example test. * * Expected result is delimited as follows; the expected response - * here is "hello world\n". Multiple expected blocks may exist, + * here is 'hello world\n'. Multiple expected blocks may exist, * they are simply concatenated. This allows tests to be written * in segments. */ /*--- -{ - "comment": "a single metadata block may exist; it is formatted as a JSON object" -} +comment: 'a single metadata block may exist; it is formatted as a JSON or YAML object' ---*/ /*=== @@ -18,13 +16,15 @@ hello world ===*/ if (1) { - print("hello world"); /* automatic newline */ + print('hello world'); /* automatic newline */ } else { - print("not quite"); + print('not quite'); } +print('shorthand'); //>shorthand + /*=== another ===*/ -print("another"); +print('another'); diff --git a/tests/ecmascript/test-lex-comments-shebang.js b/tests/ecmascript/test-lex-comments-shebang.js index 98d2fd38..b1b2cd88 100644 --- a/tests/ecmascript/test-lex-comments-shebang.js +++ b/tests/ecmascript/test-lex-comments-shebang.js @@ -47,8 +47,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-lex-es2019-u2028-u2029-literal.js b/tests/ecmascript/test-lex-es2019-u2028-u2029-literal.js index b307fcd3..c8be90eb 100644 --- a/tests/ecmascript/test-lex-es2019-u2028-u2029-literal.js +++ b/tests/ecmascript/test-lex-es2019-u2028-u2029-literal.js @@ -28,8 +28,4 @@ function test() { dump(eval(inp)); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-lex-es6-binary-literal.js b/tests/ecmascript/test-lex-es6-binary-literal.js index 653389c9..3c4c6f1e 100644 --- a/tests/ecmascript/test-lex-es6-binary-literal.js +++ b/tests/ecmascript/test-lex-es6-binary-literal.js @@ -36,8 +36,4 @@ function test() { f('(function () { "use strict"; return 0b11111111; })()'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-lex-es6-octal-literal.js b/tests/ecmascript/test-lex-es6-octal-literal.js index 9f407dac..2f74e61e 100644 --- a/tests/ecmascript/test-lex-es6-octal-literal.js +++ b/tests/ecmascript/test-lex-es6-octal-literal.js @@ -34,8 +34,4 @@ function test() { f('(function () { "use strict"; return 0o76543210; })()'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-lex-es6-unicode-escape.js b/tests/ecmascript/test-lex-es6-unicode-escape.js index eab766db..dd15b292 100644 --- a/tests/ecmascript/test-lex-es6-unicode-escape.js +++ b/tests/ecmascript/test-lex-es6-unicode-escape.js @@ -131,12 +131,8 @@ function stringLiteralTest() { }); } -try { - print('string literal'); - stringLiteralTest(); -} catch (e) { - print(e.stack || e); -} +print('string literal'); +stringLiteralTest(); /*=== plain escape @@ -190,9 +186,5 @@ function plainEscapeTest() { }); } -try { - print('plain escape'); - plainEscapeTest(); -} catch (e) { - print(e.stack || e); -} +print('plain escape'); +plainEscapeTest(); diff --git a/tests/ecmascript/test-lex-identifier.js b/tests/ecmascript/test-lex-identifier.js index f0d79c39..ab21a9fc 100644 --- a/tests/ecmascript/test-lex-identifier.js +++ b/tests/ecmascript/test-lex-identifier.js @@ -23,7 +23,6 @@ try { print(e.name); } - /* * Escapes in IdentifierStart and IdentifierPart */ diff --git a/tests/ecmascript/test-lex-line-continuation.js b/tests/ecmascript/test-lex-line-continuation.js index a2956bab..1677629c 100644 --- a/tests/ecmascript/test-lex-line-continuation.js +++ b/tests/ecmascript/test-lex-line-continuation.js @@ -8,10 +8,6 @@ This is a line continuation. var str; -try { - str = '"This is a \\\nline continuation."'; - print(str); - print(eval(str)); -} catch (e) { - print(e.name); -} +str = '"This is a \\\nline continuation."'; +print(str); +print(eval(str)); diff --git a/tests/ecmascript/test-lex-lineterm.js b/tests/ecmascript/test-lex-lineterm.js index f8fd8a9d..72848fd4 100644 --- a/tests/ecmascript/test-lex-lineterm.js +++ b/tests/ecmascript/test-lex-lineterm.js @@ -6,9 +6,7 @@ */ /*--- -{ - "skip": true -} +skip: true ---*/ /* XXX: to be implemented */ diff --git a/tests/ecmascript/test-lex-regexp-stmts.js b/tests/ecmascript/test-lex-regexp-stmts.js index 233f0078..4abf6c68 100644 --- a/tests/ecmascript/test-lex-regexp-stmts.js +++ b/tests/ecmascript/test-lex-regexp-stmts.js @@ -84,7 +84,6 @@ NaN - /foo/ / /bar/ /foo/ - /foo///bar/ NaN - /foo/g/ /bar/ NaN - /foo/g/ /bar/im -done ===*/ var sources = [ @@ -225,5 +224,3 @@ sources.forEach(function (src) { print(f(e.name) + ' - ' + fmtSrc); } }); - -print('done'); diff --git a/tests/ecmascript/test-lex-string-lengths.js b/tests/ecmascript/test-lex-string-lengths.js index 59dad797..e166a8d2 100644 --- a/tests/ecmascript/test-lex-string-lengths.js +++ b/tests/ecmascript/test-lex-string-lengths.js @@ -18,7 +18,6 @@ run 7000 8000 9000 -done ===*/ function test() { @@ -39,12 +38,6 @@ function test() { var src = '"' + str.substring(0, j) + '" + "' + str.substring(0, k) + '"'; if (eval(src).length !== j + k) { throw new Error('failed with lengths: ' + j + ', ' + k); } } - - print('done'); } -try { - test(); -} catch (e) { - print(e.stack || e); -} +test(); diff --git a/tests/ecmascript/test-lex-string.js b/tests/ecmascript/test-lex-string.js index dbd3c15f..edd83640 100644 --- a/tests/ecmascript/test-lex-string.js +++ b/tests/ecmascript/test-lex-string.js @@ -3,9 +3,7 @@ */ /*--- -{ - "skip": true -} +skip: true ---*/ /* XXX: These are covered by other tests, but add some basic tests. */ diff --git a/tests/ecmascript/test-lex-unicode-control-chars.js b/tests/ecmascript/test-lex-unicode-control-chars.js index 1e92c543..554d7569 100644 --- a/tests/ecmascript/test-lex-unicode-control-chars.js +++ b/tests/ecmascript/test-lex-unicode-control-chars.js @@ -9,9 +9,7 @@ */ /*--- -{ - "skip": true -} +skip: true ---*/ /* XXX: add tests */ diff --git a/tests/ecmascript/test-lex-utf8.js b/tests/ecmascript/test-lex-utf8.js index b6db19d8..5044f019 100644 --- a/tests/ecmascript/test-lex-utf8.js +++ b/tests/ecmascript/test-lex-utf8.js @@ -11,11 +11,11 @@ hello world! ===*/ -// These chars are in UTF-8 format in the source file +// These chars are in UTF-8 format in the source file. print('äö'); print('变量'); -/* Note: smjs fails the tests below (Rhino does not) */ +// Note: smjs fails the tests below (Rhino does not). $äöå = 1; print($äöå, typeof $äöå); diff --git a/tests/ecmascript/test-lex-whitespace.js b/tests/ecmascript/test-lex-whitespace.js index f67195c1..7f333d9b 100644 --- a/tests/ecmascript/test-lex-whitespace.js +++ b/tests/ecmascript/test-lex-whitespace.js @@ -4,9 +4,7 @@ */ /*--- -{ - "skip": true -} +skip: true ---*/ /* XXX: add tests */ diff --git a/tests/ecmascript/test-misc-array-fast-write.js b/tests/ecmascript/test-misc-array-fast-write.js index af56ae9b..7a307ca3 100644 --- a/tests/ecmascript/test-misc-array-fast-write.js +++ b/tests/ecmascript/test-misc-array-fast-write.js @@ -32,9 +32,10 @@ */ /*--- -{ - "custom": true -} +custom: true +duktape_config: + DUK_USE_ARRAY_FASTPATH: true + DUK_USE_ARRAY_PROP_FASTPATH: true ---*/ /*=== @@ -242,8 +243,4 @@ function arrayFastWriteTest() { print(arr.length, JSON.stringify(arr)); } -try { - arrayFastWriteTest(); -} catch (e) { - print(e.stack || e); -} +arrayFastWriteTest(); diff --git a/tests/ecmascript/test-misc-asmjs.js b/tests/ecmascript/test-misc-asmjs.js index 70fcdb7a..5c862465 100644 --- a/tests/ecmascript/test-misc-asmjs.js +++ b/tests/ecmascript/test-misc-asmjs.js @@ -16,11 +16,7 @@ function declarationTest() { print(typeof this); // strict: 'undefined', non-strict: 'object' } -try { - declarationTest.call(undefined); -} catch (e) { - print(e); -} +declarationTest.call(undefined); /*=== 5 @@ -49,9 +45,5 @@ function DiagModule(stdlib) { return { diag: diag }; } -try { - var mod = DiagModule(this); // this = global object - print(mod.diag(3, 4)); // -> 5 -} catch (e) { - print(e); -} +var mod = DiagModule(this); // this = global object +print(mod.diag(3, 4)); // -> 5 diff --git a/tests/ecmascript/test-misc-assign-prop-value.js b/tests/ecmascript/test-misc-assign-prop-value.js index 4e81977f..9856a06e 100644 --- a/tests/ecmascript/test-misc-assign-prop-value.js +++ b/tests/ecmascript/test-misc-assign-prop-value.js @@ -5,18 +5,14 @@ string quux var obj, val; -try { - obj = {}; - val = (obj.foo = 'bar'); - print(typeof val, val); +obj = {}; +val = (obj.foo = 'bar'); +print(typeof val, val); - /* The fact that the assignment fails should have no effect on the - * value of the assignment expression. V8 3.7.12.22 evaluates the - * assignment to 'undefined' if the property write fails. - */ - Object.preventExtensions(obj); - val = (obj.bar = 'quux'); - print(typeof val, val); -} catch (e) { - print(e); -} +/* The fact that the assignment fails should have no effect on the + * value of the assignment expression. V8 3.7.12.22 evaluates the + * assignment to 'undefined' if the property write fails. + */ +Object.preventExtensions(obj); +val = (obj.bar = 'quux'); +print(typeof val, val); diff --git a/tests/ecmascript/test-misc-do-while-without-term.js b/tests/ecmascript/test-misc-do-while-without-term.js index 8b7681d2..543134d3 100644 --- a/tests/ecmascript/test-misc-do-while-without-term.js +++ b/tests/ecmascript/test-misc-do-while-without-term.js @@ -18,9 +18,5 @@ OK ===*/ -try { - eval("do{;}while(false)false"); - print("OK"); -} catch (e) { - print(e.name); -} +eval("do{;}while(false)false"); +print("OK"); diff --git a/tests/ecmascript/test-misc-e51-corrections.js b/tests/ecmascript/test-misc-e51-corrections.js index b2320cc8..38634bff 100644 --- a/tests/ecmascript/test-misc-e51-corrections.js +++ b/tests/ecmascript/test-misc-e51-corrections.js @@ -14,14 +14,10 @@ barfoo * (The character value (CV) is defined to be the empty character.) */ -try { - print("foo\ +print("foo\ bar"); - print('bar\ +print('bar\ foo'); -} catch (e) { - print(e); -} /*=== imm1 @@ -101,11 +97,7 @@ function forToBooleanTest() { } } -try { - forToBooleanTest(); -} catch (e) { - print(e); -} +forToBooleanTest(); /*=== ===*/ @@ -135,29 +127,17 @@ undefined */ /* break/continue tests are simply syntax tests */ -try { - print('switch-break'); - print(eval('(function() { switch(123) { case 123: break\n; }; })()')); -} catch (e) { - print(e); -} +print('switch-break'); +print(eval('(function() { switch(123) { case 123: break\n; }; })()')); -try { - print('for-continue'); - print(eval('(function() { for (;;) { break; continue\n; } })()')); -} catch (e) { - print(e); -} +print('for-continue'); +print(eval('(function() { for (;;) { break; continue\n; } })()')); -try { - /* if 'return\n;' is parsed as 'return; ;' it would make the if-statement - * invalid, so this is a more useful test. - */ - print('function-return'); - print(eval('(function() { if (true) return\n;else return 234 })()')); -} catch (e) { - print(e); -} +/* if 'return\n;' is parsed as 'return; ;' it would make the if-statement + * invalid, so this is a more useful test. + */ +print('function-return'); +print(eval('(function() { if (true) return\n;else return 234 })()')); /*=== ===*/ @@ -178,12 +158,8 @@ NaN * (Already works, demonstrate with empty string: NaN is provided by step 12.) */ -try { - print(parseInt('')); - print(parseInt(' ')); -} catch (e) { - print(e); -} +print(parseInt('')); +print(parseInt(' ')); /*=== NaN @@ -196,12 +172,8 @@ NaN * as empty string doesn't match StrDecimalLiteral.) */ -try { - print(parseFloat('')); - print(parseFloat(' ')); -} catch (e) { - print(e); -} +print(parseFloat('')); +print(parseFloat(' ')); /*=== %23[]!'()* @@ -218,12 +190,8 @@ try { * doc/uri.txt for discussion.) */ -try { - print(decodeURI("%23%5B%5D%21%27%28%29%2A")); - print(encodeURI("#[]!'()*")); -} catch (e) { - print(e); -} +print(decodeURI("%23%5B%5D%21%27%28%29%2A")); +print(encodeURI("#[]!'()*")); /*=== ===*/ @@ -305,12 +273,7 @@ undefined /* 15.4.4.18: In step 9 of the algorithm, undefined is now the specified return value. */ -try { - print([1,2,3].forEach(function(x) { print('forEach:', x); })); - -} catch (e) { - print(e); -} +print([1,2,3].forEach(function(x) { print('forEach:', x); })); /*=== reduce: 1 2 1 1,2,3 @@ -331,27 +294,19 @@ reduceRight this: undefined undefined * (Test 'this' binding, must use a strict function to get in unmangled.) */ -try { - print([1,2,3].reduce(function(accumulator, kValue, k, O) { - 'use strict'; - print('reduce:', accumulator, kValue, k, O); - print('reduce this:', typeof this, this); - return accumulator + kValue; // sum - })); -} catch (e) { - print(e); -} +print([1,2,3].reduce(function(accumulator, kValue, k, O) { + 'use strict'; + print('reduce:', accumulator, kValue, k, O); + print('reduce this:', typeof this, this); + return accumulator + kValue; // sum +})); -try { - print([1,2,3].reduceRight(function(accumulator, kValue, k, O) { - 'use strict'; - print('reduceRight:', accumulator, kValue, k, O); - print('reduceRight this:', typeof this, this); - return accumulator + kValue; // sum - })); -} catch (e) { - print(e); -} +print([1,2,3].reduceRight(function(accumulator, kValue, k, O) { + 'use strict'; + print('reduceRight:', accumulator, kValue, k, O); + print('reduceRight this:', typeof this, this); + return accumulator + kValue; // sum +})); /*=== ===*/ @@ -461,11 +416,7 @@ function errMessageTest1() { print(JSON.stringify(e3.message)); } -try { - errMessageTest1(); -} catch (e) { - print(e); -} +errMessageTest1(); /*=== "Error" @@ -481,11 +432,7 @@ function errMessageTest2() { print(JSON.stringify(e2.toString())); } -try { - errMessageTest2(); -} catch (e) { - print(e); -} +errMessageTest2(); /*=== ===*/ diff --git a/tests/ecmascript/test-misc-large-expressions.js b/tests/ecmascript/test-misc-large-expressions.js index 1bfef1d8..9e91223c 100644 --- a/tests/ecmascript/test-misc-large-expressions.js +++ b/tests/ecmascript/test-misc-large-expressions.js @@ -35,9 +35,7 @@ var extVar = 0; // dummy assignment target /*--- -{ - "slow": true -} +slow: true ---*/ /*=== @@ -179,8 +177,4 @@ function largeExprTest() { print('large expressions') -try { - largeExprTest(); -} catch (e) { - print(e.stack || e); -} +largeExprTest(); diff --git a/tests/ecmascript/test-misc-large-literal.js b/tests/ecmascript/test-misc-large-literal.js index c9f4a06d..8f68c4e7 100644 --- a/tests/ecmascript/test-misc-large-literal.js +++ b/tests/ecmascript/test-misc-large-literal.js @@ -24,13 +24,9 @@ function test(n) { eval(src); } -try { - test(100); - print('test 1 ok'); - test(200); - print('test 2 ok'); - test(10000); - print('test 3 ok'); -} catch (e) { - print(e); -} +test(100); +print('test 1 ok'); +test(200); +print('test 2 ok'); +test(10000); +print('test 3 ok'); diff --git a/tests/ecmascript/test-misc-many-closures.js b/tests/ecmascript/test-misc-many-closures.js index 0d55d53b..f4ff1114 100644 --- a/tests/ecmascript/test-misc-many-closures.js +++ b/tests/ecmascript/test-misc-many-closures.js @@ -20,13 +20,9 @@ function test(n) { eval(src); } -try { - test(100); - print('test 1 ok'); - test(200); - print('test 2 ok'); - test(10000); - print('test 3 ok'); -} catch (e) { - print(e); -} +test(100); +print('test 1 ok'); +test(200); +print('test 2 ok'); +test(10000); +print('test 3 ok'); diff --git a/tests/ecmascript/test-misc-many-consts.js b/tests/ecmascript/test-misc-many-consts.js index ef6c671c..d89d625f 100644 --- a/tests/ecmascript/test-misc-many-consts.js +++ b/tests/ecmascript/test-misc-many-consts.js @@ -75,16 +75,8 @@ function testObject(num) { print('object', num, keys.length, len); } -try { - [0, 10, 100, 253, 254, 255, 256, 257, 300, 3000, 10000, 65000] - .forEach(function(x) { testArray(x); }); -} catch (e) { - print(e); -} +[0, 10, 100, 253, 254, 255, 256, 257, 300, 3000, 10000, 65000] + .forEach(function(x) { testArray(x); }); -try { - [0, 10, 100, 125, 126, 127, 128, 129, 130, 253, 254, 255, 256, 257, 300, 3000, 10000, 32000] - .forEach(function(x) { testObject(x); }); -} catch (e) { - print(e); -} +[0, 10, 100, 125, 126, 127, 128, 129, 130, 253, 254, 255, 256, 257, 300, 3000, 10000, 32000] + .forEach(function(x) { testObject(x); }); diff --git a/tests/ecmascript/test-misc-numeric-property-access.js b/tests/ecmascript/test-misc-numeric-property-access.js index 4fcb00be..7faffb63 100644 --- a/tests/ecmascript/test-misc-numeric-property-access.js +++ b/tests/ecmascript/test-misc-numeric-property-access.js @@ -12,5 +12,5 @@ try { */ eval("x={5:6}; print(x.5);"); } catch (e) { - print (e.name); + print(e.name); } diff --git a/tests/ecmascript/test-misc-pointer-tostring.js b/tests/ecmascript/test-misc-pointer-tostring.js index 7042c48b..de71377d 100644 --- a/tests/ecmascript/test-misc-pointer-tostring.js +++ b/tests/ecmascript/test-misc-pointer-tostring.js @@ -1,7 +1,5 @@ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -23,8 +21,4 @@ function pointerTostringTest() { print(re_ptr_nonnull.test(ptr_nonnull.toString())); } -try { - pointerTostringTest(); -} catch (e) { - print(e); -} +pointerTostringTest(); diff --git a/tests/ecmascript/test-numconv-parse-explimit.js b/tests/ecmascript/test-numconv-parse-explimit.js index 131068ee..475c3a6b 100644 --- a/tests/ecmascript/test-numconv-parse-explimit.js +++ b/tests/ecmascript/test-numconv-parse-explimit.js @@ -1,7 +1,5 @@ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -63,8 +61,4 @@ function expLimitTest() { test('-1000000000000000000000000000000'); } -try { - expLimitTest(); -} catch (e) { - print(e); -} +expLimitTest(); diff --git a/tests/ecmascript/test-numconv-parse-expxflow.js b/tests/ecmascript/test-numconv-parse-expxflow.js index 5c49f036..755ca1aa 100644 --- a/tests/ecmascript/test-numconv-parse-expxflow.js +++ b/tests/ecmascript/test-numconv-parse-expxflow.js @@ -108,8 +108,4 @@ function expOverflowUnderflowTest() { } } -try { - expOverflowUnderflowTest(); -} catch (e) { - print(e); -} +expOverflowUnderflowTest(); diff --git a/tests/ecmascript/test-numconv-parse-hex.js b/tests/ecmascript/test-numconv-parse-hex.js index 5616d8cf..193c8ab4 100644 --- a/tests/ecmascript/test-numconv-parse-hex.js +++ b/tests/ecmascript/test-numconv-parse-hex.js @@ -61,8 +61,4 @@ function hexTest() { pI('0xg'); } -try { - hexTest(); -} catch (e) { - print(e); -} +hexTest(); diff --git a/tests/ecmascript/test-numconv-parse-limits.js b/tests/ecmascript/test-numconv-parse-limits.js index 2dacfd21..37b6157b 100644 --- a/tests/ecmascript/test-numconv-parse-limits.js +++ b/tests/ecmascript/test-numconv-parse-limits.js @@ -80,8 +80,4 @@ function limitsTest() { */ } -try { - limitsTest(); -} catch (e) { - print(e); -} +limitsTest(); diff --git a/tests/ecmascript/test-numconv-parse-mant-carry.js b/tests/ecmascript/test-numconv-parse-mant-carry.js index 55780037..db51f0c4 100644 --- a/tests/ecmascript/test-numconv-parse-mant-carry.js +++ b/tests/ecmascript/test-numconv-parse-mant-carry.js @@ -8,11 +8,7 @@ * by one. The final result is 2. */ -try { - print(Number('1.99999999999999989')); -} catch (e) { - print(e); -} +print(Number('1.99999999999999989')); /*=== Infinity @@ -22,8 +18,4 @@ Infinity * yielding Infinity. */ -try { - print(Number('1.79769313486231581e308')); -} catch (e) { - print(e); -} +print(Number('1.79769313486231581e308')); diff --git a/tests/ecmascript/test-numconv-parse-misc.js b/tests/ecmascript/test-numconv-parse-misc.js index 16089a94..591df29b 100644 --- a/tests/ecmascript/test-numconv-parse-misc.js +++ b/tests/ecmascript/test-numconv-parse-misc.js @@ -135,8 +135,4 @@ function miscTest() { pFloat('0.00010000000000000000000000'); } -try { - miscTest(); -} catch (e) { - print(e); -} +miscTest(); diff --git a/tests/ecmascript/test-numconv-parse-octal.js b/tests/ecmascript/test-numconv-parse-octal.js index 5c7d025e..3221c6eb 100644 --- a/tests/ecmascript/test-numconv-parse-octal.js +++ b/tests/ecmascript/test-numconv-parse-octal.js @@ -1,7 +1,5 @@ /*--- -{ - "custom": true -} +custom: true ---*/ /*=== @@ -97,8 +95,4 @@ function octalTest() { } -try { - octalTest(); -} catch (e) { - print(e); -} +octalTest(); diff --git a/tests/ecmascript/test-numconv-tostring-exp.js b/tests/ecmascript/test-numconv-tostring-exp.js index c727d51a..4ded8119 100644 --- a/tests/ecmascript/test-numconv-tostring-exp.js +++ b/tests/ecmascript/test-numconv-tostring-exp.js @@ -43,8 +43,4 @@ function expTest() { test(-0, 2); } -try { - expTest(); -} catch (e) { - print(e); -} +expTest(); diff --git a/tests/ecmascript/test-numconv-tostring-fastpath.js b/tests/ecmascript/test-numconv-tostring-fastpath.js index 80344371..0609af79 100644 --- a/tests/ecmascript/test-numconv-tostring-fastpath.js +++ b/tests/ecmascript/test-numconv-tostring-fastpath.js @@ -7,9 +7,7 @@ */ /*--- -{ - "slow": true -} +slow: true ---*/ /*@include util-string.js@*/ @@ -374,8 +372,4 @@ function fastPathTest() { } } -try { - fastPathTest(); -} catch (e) { - print(e); -} +fastPathTest(); diff --git a/tests/ecmascript/test-numconv-tostring-fixed.js b/tests/ecmascript/test-numconv-tostring-fixed.js index d80b7b32..08b4e65d 100644 --- a/tests/ecmascript/test-numconv-tostring-fixed.js +++ b/tests/ecmascript/test-numconv-tostring-fixed.js @@ -84,8 +84,4 @@ function fixedTest() { test(0.999999999, 7); // round up and wrap } -try { - fixedTest(); -} catch (e) { - print(e); -} +fixedTest(); diff --git a/tests/ecmascript/test-numconv-tostring-gen.js b/tests/ecmascript/test-numconv-tostring-gen.js index 55517431..164e1c13 100644 --- a/tests/ecmascript/test-numconv-tostring-gen.js +++ b/tests/ecmascript/test-numconv-tostring-gen.js @@ -29580,8 +29580,4 @@ function test() { } } -try { - test(); -} catch (e) { - print(e); -} +test(); diff --git a/tests/ecmascript/test-numconv-tostring-math-const.js b/tests/ecmascript/test-numconv-tostring-math-const.js index b11352f6..09c0c9b3 100644 --- a/tests/ecmascript/test-numconv-tostring-math-const.js +++ b/tests/ecmascript/test-numconv-tostring-math-const.js @@ -18,8 +18,4 @@ function mathConstTest() { } } -try { - mathConstTest() -} catch (e) { - print(e); -} +mathConstTest() diff --git a/tests/ecmascript/test-numconv-tostring-misc.js b/tests/ecmascript/test-numconv-tostring-misc.js index 9e3a7f75..af5907c6 100644 --- a/tests/ecmascript/test-numconv-tostring-misc.js +++ b/tests/ecmascript/test-numconv-tostring-misc.js @@ -9,8 +9,4 @@ function miscTest() { print(1e23); } -try { - miscTest(); -} catch (e) { - print(e); -} +miscTest(); diff --git a/tests/ecmascript/test-numconv-tostring-prec.js b/tests/ecmascript/test-numconv-tostring-prec.js index 4c936479..55ee8f8d 100644 --- a/tests/ecmascript/test-numconv-tostring-prec.js +++ b/tests/ecmascript/test-numconv-tostring-prec.js @@ -69,8 +69,4 @@ function precisionTest() { test(-0, 3); } -try { - precisionTest(); -} catch (e) { - print(e); -} +precisionTest();