Browse Source

Testcase cleanup

pull/2498/head
Sami Vaarala 2 years ago
parent
commit
6f6609fd69
  1. 8
      tests/ecmascript/.editorconfig
  2. 20
      tests/ecmascript/test-bug-act-linenumber-gh143.js
  3. 6
      tests/ecmascript/test-bug-array-fastpath-push-retval.js
  4. 6
      tests/ecmascript/test-bug-array-proto-protected-1.js
  5. 8
      tests/ecmascript/test-bug-array-slice-end.js
  6. 12
      tests/ecmascript/test-bug-arridx-1.js
  7. 6
      tests/ecmascript/test-bug-assert-cbor-encode-gh2316.js
  8. 2
      tests/ecmascript/test-bug-assert-property-add-gh2315.js
  9. 6
      tests/ecmascript/test-bug-assign-mutate-gh381.js
  10. 6
      tests/ecmascript/test-bug-autosemi-1.js
  11. 10
      tests/ecmascript/test-bug-base64-dec-whitespace-padding.js
  12. 6
      tests/ecmascript/test-bug-base64-dec-zerolen-dynamic-buffer-gh2027.js
  13. 6
      tests/ecmascript/test-bug-bound-constructable-judofyr.js
  14. 20
      tests/ecmascript/test-bug-bound-func-caller-arguments.js
  15. 20
      tests/ecmascript/test-bug-buffer-assign-x.js
  16. 10
      tests/ecmascript/test-bug-bufferobject-cast-gh336.js
  17. 6
      tests/ecmascript/test-bug-call-valstack-segfault-gh107.js
  18. 27
      tests/ecmascript/test-bug-case-fallthrough.js
  19. 7
      tests/ecmascript/test-bug-cbor-reclimit-gh2327.js
  20. 32
      tests/ecmascript/test-bug-comma-expr-gh131.js
  21. 6
      tests/ecmascript/test-bug-commonjs-relative-id.js
  22. 6
      tests/ecmascript/test-bug-compare-eval-order.js
  23. 2
      tests/ecmascript/test-bug-compiler-gh2025.js
  24. 2
      tests/ecmascript/test-bug-compiler-gh2026.js
  25. 2
      tests/ecmascript/test-bug-compiler-gh2033.js
  26. 2
      tests/ecmascript/test-bug-compiler-gh2035.js
  27. 2
      tests/ecmascript/test-bug-compiler-gh2036.js
  28. 6
      tests/ecmascript/test-bug-const-overflow.js
  29. 4
      tests/ecmascript/test-bug-coroutine-yield-refzero-1-gh2204.js
  30. 4
      tests/ecmascript/test-bug-coroutine-yield-refzero-2-gh2204.js
  31. 2
      tests/ecmascript/test-bug-currpc-blit-gh294.js
  32. 24
      tests/ecmascript/test-bug-currpc-sync-gh294.js
  33. 12
      tests/ecmascript/test-bug-currpc-unwind-gh294.js
  34. 8
      tests/ecmascript/test-bug-date-insane-setyear.js
  35. 8
      tests/ecmascript/test-bug-date-nan-tzoffset.js
  36. 8
      tests/ecmascript/test-bug-date-setyear-overflow.js
  37. 24
      tests/ecmascript/test-bug-date-timeval-edges.js
  38. 14
      tests/ecmascript/test-bug-dowhile-with-break.js
  39. 10
      tests/ecmascript/test-bug-duktape-gc-retval.js
  40. 6
      tests/ecmascript/test-bug-empty-finally-segfault-gh268.js
  41. 12
      tests/ecmascript/test-bug-enum-shadow-nonenumerable.js
  42. 6
      tests/ecmascript/test-bug-enum-shuffle-gh132.js
  43. 7
      tests/ecmascript/test-bug-envclose-assert-gh2022.js
  44. 6
      tests/ecmascript/test-bug-error-linenumber-1.js
  45. 6
      tests/ecmascript/test-bug-error-linenumber-2.js
  46. 10
      tests/ecmascript/test-bug-error-tostring-replacement-gh254.js
  47. 4
      tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-1.js
  48. 4
      tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-2.js
  49. 4
      tests/ecmascript/test-bug-finalizer-repro-gh1311.js
  50. 4
      tests/ecmascript/test-bug-finalizer-rescue.js
  51. 6
      tests/ecmascript/test-bug-finally-ljtype-gh287.js
  52. 6
      tests/ecmascript/test-bug-for-multivar.js
  53. 18
      tests/ecmascript/test-bug-fromcharcode-argcount.js
  54. 12
      tests/ecmascript/test-bug-getownpropdesc-proto.js
  55. 6
      tests/ecmascript/test-bug-getpropc-errcreate-gh2061.js
  56. 6
      tests/ecmascript/test-bug-getset-func-name.js
  57. 3
      tests/ecmascript/test-bug-global-eval-redeclare.js
  58. 6
      tests/ecmascript/test-bug-invalid-oct-as-dec.js
  59. 6
      tests/ecmascript/test-bug-isprototypeof-assert-gh1162.js
  60. 10
      tests/ecmascript/test-bug-json-bufobj.js
  61. 12
      tests/ecmascript/test-bug-json-fastpath-boxedptr.js
  62. 12
      tests/ecmascript/test-bug-json-fastpath-unbox-coercion.js
  63. 6
      tests/ecmascript/test-bug-json-fastpath-unbox-recursion.js
  64. 6
      tests/ecmascript/test-bug-json-parse-__proto__.js
  65. 13
      tests/ecmascript/test-bug-json-parse-posexpt.js
  66. 2
      tests/ecmascript/test-bug-json-reviver-array-recursion.js
  67. 2
      tests/ecmascript/test-bug-json-stringify-proplist-inherited-gh2202.js
  68. 10
      tests/ecmascript/test-bug-jx-minusinf.js
  69. 6
      tests/ecmascript/test-bug-labelled-block.js
  70. 18
      tests/ecmascript/test-bug-labelled-stmts.js
  71. 22
      tests/ecmascript/test-bug-lex-regexp-2.js
  72. 18
      tests/ecmascript/test-bug-localecompare-nul.js
  73. 16
      tests/ecmascript/test-bug-lt-nul.js
  74. 6
      tests/ecmascript/test-bug-mingw-math-issues.js
  75. 4
      tests/ecmascript/test-bug-modloaded-cache-inherit.js
  76. 14
      tests/ecmascript/test-bug-nested-prop-mutate.js
  77. 6
      tests/ecmascript/test-bug-netbsd-math-pow.js
  78. 6
      tests/ecmascript/test-bug-nodejs-buffer-slice-isview.js
  79. 4
      tests/ecmascript/test-bug-nregs-limit-gh111.js
  80. 10
      tests/ecmascript/test-bug-numconv-1e23.js
  81. 8
      tests/ecmascript/test-bug-numconv-denorm-toprec.js
  82. 6
      tests/ecmascript/test-bug-numconv-expxflow.js
  83. 6
      tests/ecmascript/test-bug-numconv-mantissa-assert.js
  84. 6
      tests/ecmascript/test-bug-object-binding-proxy.js
  85. 10
      tests/ecmascript/test-bug-object-defprop-eidx-1.js
  86. 10
      tests/ecmascript/test-bug-object-defprop-eidx-2.js
  87. 10
      tests/ecmascript/test-bug-object-delprop-eidx-1.js
  88. 4
      tests/ecmascript/test-bug-object-literal-getset-tempreg.js
  89. 16
      tests/ecmascript/test-bug-object-prop-alloc-unbounded.js
  90. 6
      tests/ecmascript/test-bug-object-proto-protected-1.js
  91. 7
      tests/ecmascript/test-bug-oom-nested-error-gh2278.js
  92. 15
      tests/ecmascript/test-bug-packed-tval-nan-normalize.js
  93. 6
      tests/ecmascript/test-bug-parseint-radix16-leadingzero-gh413.js
  94. 63
      tests/ecmascript/test-bug-plus-coercion-gh2019.js
  95. 6
      tests/ecmascript/test-bug-prop-set-get-default-value.js
  96. 6
      tests/ecmascript/test-bug-propread-mutate.js
  97. 3
      tests/ecmascript/test-bug-props-asize-gh2023-2.js
  98. 3
      tests/ecmascript/test-bug-props-asize-gh2023.js
  99. 6
      tests/ecmascript/test-bug-proxy-bound-assert-gh2049.js
  100. 4
      tests/ecmascript/test-bug-proxy-finalizer-double-call.js

8
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

20
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() {

6
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();

6
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();

8
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));

12
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

6
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');

2
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');

6
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();

6
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();

10
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();

6
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');

6
tests/ecmascript/test-bug-bound-constructable-judofyr.js

@ -25,8 +25,4 @@ function test() {
print(obj.value);
}
try {
test();
} catch (e) {
print(e);
}
test();

20
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');

20
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]);

10
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();

6
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();

27
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();

7
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');

32
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());

6
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();

6
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();

2
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');

2
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');

2
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');

2
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');

2
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');

6
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();");

4
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

4
tests/ecmascript/test-bug-coroutine-yield-refzero-2-gh2204.js

@ -1,3 +1,7 @@
/*---
custom: true
---*/
/*===
RangeError: aiee
done

2
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');

24
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();

12
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');

8
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();

8
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());

8
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();

24
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();

14
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();

10
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());

6
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');

12
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();

6
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();

7
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');

6
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();

6
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();

10
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();

4
tests/ecmascript/test-bug-finalizer-coroutine-resume-gh2030-1.js

@ -2,6 +2,10 @@
* https://github.com/svaarala/duktape/issues/2030
*/
/*---
custom: true
---*/
/*===
done
===*/

4
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

4
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

4
tests/ecmascript/test-bug-finalizer-rescue.js

@ -1,7 +1,5 @@
/*---
{
"custom": true
}
custom: true
---*/
/*===

6
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');

6
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; }

18
tests/ecmascript/test-bug-fromcharcode-argcount.js

@ -19,31 +19,27 @@ function test(count) {
return eval(src.join(''));
}
try {
var t;
var t;
try {
try {
t = test(250);
print(t.length);
print(t);
} catch (e) {
} catch (e) {
print(e.name);
}
}
/* This currently fails due to Duktape register count limits; the failure is
/* 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 {
try {
t = test(300);
print(t.length);
print(t);
} catch (e) {
print(e.name);
}
} catch (e) {
print(e.stack || e);
print(e.name);
}

12
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);

6
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');

6
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();

3
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');

6
tests/ecmascript/test-bug-invalid-oct-as-dec.js

@ -49,8 +49,4 @@ function octalTest() {
p('099');
}
try {
octalTest();
} catch (e) {
print(e);
}
octalTest();

6
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));

10
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();

12
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();

12
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();

6
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();

6
tests/ecmascript/test-bug-json-parse-__proto__.js

@ -99,8 +99,4 @@ function test() {
}));
}
try {
test();
} catch (e) {
print(e);
}
test();

13
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();

2
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');

2
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');

10
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();

6
tests/ecmascript/test-bug-labelled-block.js

@ -37,8 +37,4 @@ function labelledBlockTest() {
print("after loop 2");
}
try {
labelledBlockTest();
} catch (e) {
print(e);
}
labelledBlockTest();

18
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();

22
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));

18
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(''));

16
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' < '');

6
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();

4
tests/ecmascript/test-bug-modloaded-cache-inherit.js

@ -4,6 +4,10 @@
* trying to load a module.
*/
/*---
custom: true
---*/
/*===
TypeError
===*/

14
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();

6
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();

6
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();

4
tests/ecmascript/test-bug-nregs-limit-gh111.js

@ -3,9 +3,7 @@
*/
/*---
{
"custom": true
}
custom: true
---*/
/*===

10
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));

8
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));

6
tests/ecmascript/test-bug-numconv-expxflow.js

@ -22,8 +22,4 @@ function expOverflowUnderflowTest() {
print(val);
}
try {
expOverflowUnderflowTest();
} catch (e) {
print(e);
}
expOverflowUnderflowTest();

6
tests/ecmascript/test-bug-numconv-mantissa-assert.js

@ -10,8 +10,4 @@
7.555786372591432e+22
===*/
try {
print(75557863725914323419136);
} catch (e) {
print(e);
}
print(75557863725914323419136);

6
tests/ecmascript/test-bug-object-binding-proxy.js

@ -48,8 +48,4 @@ function test() {
}
}
try {
test();
} catch (e) {
print(e.stack || e);
}
test();

10
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();

10
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();

10
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();

4
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

16
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);

6
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();

7
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();

15
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);

6
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();

63
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(-' ');

6
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();

6
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();

3
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');

3
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');

6
tests/ecmascript/test-bug-proxy-bound-assert-gh2049.js

@ -36,9 +36,3 @@ try {
} catch (e) {
print(e.stack || e);
}
/*===
done
===*/
print('done');

4
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]

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save