diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/js1_7/regress | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/js1_7/regress')
51 files changed, 1754 insertions, 0 deletions
diff --git a/js/src/tests/js1_7/regress/browser.js b/js/src/tests/js1_7/regress/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/js1_7/regress/browser.js diff --git a/js/src/tests/js1_7/regress/regress-350387.js b/js/src/tests/js1_7/regress/regress-350387.js new file mode 100644 index 000000000..6bdf33dd7 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-350387.js @@ -0,0 +1,38 @@ +// |reftest| skip -- obsolete test +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 350387; +var summary = 'Var declaration and let with same name'; +var actual = ''; +var expect = ''; + +expect = undefined + ''; +actual = ''; +let (x = 2) +{ + var x; +} +actual = x + ''; +reportCompare(expect, actual, summary + ': 1'); + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = undefined + ''; + actual = ''; + (function () { let (x = 2) { var x; } actual = x + ''; })(); + reportCompare(expect, actual, summary + ': 2'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-352640-01.js b/js/src/tests/js1_7/regress/regress-352640-01.js new file mode 100644 index 000000000..0ed722e41 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-352640-01.js @@ -0,0 +1,33 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 352640; +var summary = 'Do not assert: scopeStmt or crash @ js_LexicalLookup'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + new Function("do { with({}) let x; let b; } while( 1 );"); + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-352640-02.js b/js/src/tests/js1_7/regress/regress-352640-02.js new file mode 100644 index 000000000..6336e4e86 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-352640-02.js @@ -0,0 +1,33 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 352640; +var summary = 'Do not assert: scopeStmt or crash @ js_LexicalLookup'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + new Function("do { with({}) let x; var b; } while( 1 );"); + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-352640-03.js b/js/src/tests/js1_7/regress/regress-352640-03.js new file mode 100644 index 000000000..0499101b0 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-352640-03.js @@ -0,0 +1,33 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 352640; +var summary = 'Do not assert: scopeStmt or crash @ js_LexicalLookup'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + new Function("do { with({}) let x; [2 for each (b in [])]; } while( 1 );"); + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-352640-04.js b/js/src/tests/js1_7/regress/regress-352640-04.js new file mode 100644 index 000000000..477695126 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-352640-04.js @@ -0,0 +1,33 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 352640; +var summary = 'Do not assert: scopeStmt or crash @ js_LexicalLookup'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + new Function("switch(w) { case 2: with({}) let y; case 3: }"); + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-353079.js b/js/src/tests/js1_7/regress/regress-353079.js new file mode 100644 index 000000000..2c7fd015f --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-353079.js @@ -0,0 +1,29 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 353079; +var summary = 'Do not Assert op == JSOP_LEAVEBLOCKEXPR... with WAY_TOO_MUCH_GC'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (let a in [1]) { { let x; + for (let y in ((function(id2) { return id2; })( '' ))) { } } } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-355023.js b/js/src/tests/js1_7/regress/regress-355023.js new file mode 100644 index 000000000..73d055990 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-355023.js @@ -0,0 +1,31 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 355023; +var summary = 'destructuring assignment optimization'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + Array.prototype[0] = 1024; + + expect = (function(){ var a=[],[x]=a; return x; })(); + actual = (function(){ var [x]=[]; return x; })(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-355832-01.js b/js/src/tests/js1_7/regress/regress-355832-01.js new file mode 100644 index 000000000..dccf7e832 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-355832-01.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 355832; +var summary = 'execution of let binding nothing'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = actual = 'No Crash'; + + { let [] = []; } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-355832-02.js b/js/src/tests/js1_7/regress/regress-355832-02.js new file mode 100644 index 000000000..54e1506e4 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-355832-02.js @@ -0,0 +1,30 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 355832; +var summary = 'execution of let binding nothing'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = actual = 'No Crash'; + + { let [] = []; print(3) } print(4) + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-363040-01.js b/js/src/tests/js1_7/regress/regress-363040-01.js new file mode 100644 index 000000000..dc081fe45 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-363040-01.js @@ -0,0 +1,95 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 363040; +var summary = 'Array.prototype.reduce, Array.prototype.reduceRight'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f(x,y) { return '(' + x + '+' + y + ')';} + + var testdesc; + var arr0elms = []; + var arr1elms = [1]; + var arr2elms = [1, 2]; + + testdesc = 'Test reduce of empty array without initializer.'; + try + { + expect = 'TypeError: reduce of empty array with no initial value'; + arr0elms.reduce(f); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduceRight of empty array without initializer.'; + try + { + expect = 'TypeError: reduce of empty array with no initial value'; + arr0elms.reduceRight(f); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduce of empty array with initial value.'; + expect = 'a'; + actual = arr0elms.reduce(f, 'a'); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduceRight of empty array with initial value.'; + expect = 'a'; + actual = arr0elms.reduceRight(f, 'a'); + reportCompare(expect + '', actual + '', testdesc +' : ' + expect); + + testdesc = 'Test reduce of 1 element array with no initializer.'; + expect = '1'; + actual = arr1elms.reduce(f); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduceRight of 1 element array with no initializer.'; + expect = '1'; + actual = arr1elms.reduceRight(f); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduce of 2 element array with no initializer.'; + expect = '(1+2)'; + actual = arr2elms.reduce(f); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduce of 2 element array with initializer.'; + expect = '((a+1)+2)'; + actual = arr2elms.reduce(f,'a'); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduceRight of 2 element array with no initializer.'; + expect = '(2+1)'; + actual = arr2elms.reduceRight(f); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + testdesc = 'Test reduceRight of 2 element array with no initializer.'; + expect = '((a+2)+1)'; + actual = arr2elms.reduceRight(f,'a'); + reportCompare(expect + '', actual + '', testdesc + ' : ' + expect); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-363040-02.js b/js/src/tests/js1_7/regress/regress-363040-02.js new file mode 100644 index 000000000..c24e4a605 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-363040-02.js @@ -0,0 +1,67 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 363040; +var summary = 'Array.prototype.reduce application in array flattening'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function flatten(arr) + { + function op(partial, item) + { + if (item instanceof Array) + Array.prototype.push.apply(partial, flatten(item)); + else + partial.push(item); + + return partial; + } + + return arr.reduce(op, []); + } + + expect = [1, 2, 3]; + actual = flatten([1, 2, 3]); // [1, 2, 3] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + expect = [1, 2, 3]; + actual = flatten([1, [2], 3]); // [1, 2, 3] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + expect = [2, 3]; + actual = flatten([[], 2, 3]); // [2, 3] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + expect = [1, 2, 3]; + actual = flatten([[1], 2, 3]); // [1, 2, 3] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + expect = [4]; + actual = flatten([[[[4]]]]); // [4] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + expect = [1, 2, 3]; + actual = flatten([1, [2, [3]]]); // [1, 2, 3] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + expect = []; + actual = flatten([[[[[]]]]]); // [] + reportCompare(expect + '', actual + '', summary + ': ' + expect); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-369666-01.js b/js/src/tests/js1_7/regress/regress-369666-01.js new file mode 100644 index 000000000..1be90603f --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-369666-01.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 369666; +var summary = 'inner function declaration in let-induced outer ' + + 'function body gets wrong scope.'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function foo() { + let x = 42 + + function bar() { + return x; + } + + return bar; + } + + print(foo()()); + + baz = false; + + function foo2() { + let x = 42 + + function bar() { + return x; + } + + try { + if (baz) + return bar; + } finally { + print('finally', x); + } + return bar; + } + + print(foo2()()); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-369666-02.js b/js/src/tests/js1_7/regress/regress-369666-02.js new file mode 100644 index 000000000..f55b49617 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-369666-02.js @@ -0,0 +1,63 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 369666; +var summary = 'inner function declaration in let-induced outer ' + + 'function body gets wrong scope.'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function foo() { + let x = 42 + + function bar() { + return x; + } + + return bar; + } + + print(foo()()); + + baz = false; + + function foo2() { + let x = 42 + + function bar() { + return x; + } + + function bletch() { + return x * x; + } + + try { + if (baz) + return bar; + } finally { + print('finally', x); + } + return bletch; + } + + print(foo2()()); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-372331.js b/js/src/tests/js1_7/regress/regress-372331.js new file mode 100644 index 000000000..a9a868724 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-372331.js @@ -0,0 +1,55 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 372331; +var summary = 'for-in should not bind name too early'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var index; + var obj = { index: 1 }; + + expect = 'No Error'; + actual = 'No Error'; + + function gen() + { + delete obj.index; + yield 2; + } + + with (obj) { + for (index in gen()); + } + + try + { + if ('index' in obj) + throw "for-in binds name to early"; + + if (index !== 2) + throw "unexpected value of index: "+index; + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-373827-01.js b/js/src/tests/js1_7/regress/regress-373827-01.js new file mode 100644 index 000000000..01da279f8 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-373827-01.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 373827; +var summary = 'Do not assert: OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_HAS_PRIVATE'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + { let [] = [{x: function(){}}]; }; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-373827-02.js b/js/src/tests/js1_7/regress/regress-373827-02.js new file mode 100644 index 000000000..3596feb69 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-373827-02.js @@ -0,0 +1,34 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 373827; +var summary = 'Do not assert: OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_HAS_PRIVATE'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + { let [] = [{x: function(){}}]; }; foo; + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-375695.js b/js/src/tests/js1_7/regress/regress-375695.js new file mode 100644 index 000000000..508560ce9 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-375695.js @@ -0,0 +1,27 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 375695; +var summary = 'Do not assert: !fp->blockChain || OBJ_GET_PARENT(cx, obj) == fp->blockChain'; +var actual = ''; +var expect = ''; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try { try { throw 1 } catch([] if false) { } } catch(ex) {} + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-379442.js b/js/src/tests/js1_7/regress/regress-379442.js new file mode 100644 index 000000000..639523270 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-379442.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 379442; +var summary = 'Regression from bug 368224'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + reportCompare(expect, actual, summary); + + (function () { ({ y: [] } = {}); }); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-379483.js b/js/src/tests/js1_7/regress/regress-379483.js new file mode 100644 index 000000000..f9ee84b30 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-379483.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 379483; +var summary = 'Do not assert: top < ss->printer->script->depth'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + (function () { try { } catch([e]) { [1]; } }); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-385133-01.js b/js/src/tests/js1_7/regress/regress-385133-01.js new file mode 100644 index 000000000..03b09f535 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-385133-01.js @@ -0,0 +1,37 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 385133; +var summary = 'Do not crash due to recursion with watch, setter, delete, generator'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + Object.defineProperty(this, "x", { set: {}.watch, enumerable: true, configurable: true }); + this.watch('x', 'foo'.split); + delete x; + function g(){ x = 1; yield; } + for (i in g()) { } + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-385133-02.js b/js/src/tests/js1_7/regress/regress-385133-02.js new file mode 100644 index 000000000..ce429dd15 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-385133-02.js @@ -0,0 +1,35 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 385133; +var summary = 'Do not crash due to recursion with watch, setter, delete, generator'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + Object.defineProperty(this, "x", { set: {}.watch, enumerable: true, configurable: true }); + function g() { x = 1; yield; } + g().next(); + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-385393-05.js b/js/src/tests/js1_7/regress/regress-385393-05.js new file mode 100644 index 000000000..c642c4ec6 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-385393-05.js @@ -0,0 +1,44 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +//----------------------------------------------------------------------------- +var BUGNUMBER = 385393; +var summary = 'Regression test for bug 385393'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function c(gen) + { + Iterator; + + "" + gen; + + for (var i in gen()) + ; + } + + function gen() + { + ({}).hasOwnProperty(); + yield; + } + + c(gen); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-407727-01.js b/js/src/tests/js1_7/regress/regress-407727-01.js new file mode 100644 index 000000000..f92113f5e --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-407727-01.js @@ -0,0 +1,17 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 407727; +var summary = 'let Object global redeclaration'; +var actual = ''; +var expect = 1; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +let Object = 1; +actual = Object; +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_7/regress/regress-407727-02.js b/js/src/tests/js1_7/regress/regress-407727-02.js new file mode 100644 index 000000000..bcc7a38ab --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-407727-02.js @@ -0,0 +1,19 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 407727; +var summary = 'let Object block redeclaration'; +var actual = ''; +var expect = 1; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +{ + let Object = 1; + actual = Object; + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_7/regress/regress-407957.js b/js/src/tests/js1_7/regress/regress-407957.js new file mode 100644 index 000000000..ffd05bd42 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-407957.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 407957; +var summary = 'Iterator is mutable.'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var obj = {}; + var saveIterator = Iterator; + + Iterator = obj; + reportCompare(obj, Iterator, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-410649.js b/js/src/tests/js1_7/regress/regress-410649.js new file mode 100644 index 000000000..ddd2b2a57 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-410649.js @@ -0,0 +1,42 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 410649; +var summary = 'function statement and destructuring parameter name clash'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f(a) { + function a() { } + return a; + } + + function g([a, b]) { + function a() { } + return a; + } + + expect = 'function'; + actual = typeof f(1); + reportCompare(expect, actual, "type for simple parameter case"); + + expect = 'function'; + actual = typeof g([1, 2]); + reportCompare(expect, actual, "type for destructuring parameter case"); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-414553.js b/js/src/tests/js1_7/regress/regress-414553.js new file mode 100644 index 000000000..6f5139022 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-414553.js @@ -0,0 +1,25 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 414553; +printBugNumber(BUGNUMBER); +printStatus(summary); + +var expected = '1,2,3,4'; + +let a = 1, [b,c] = [2,3], d = 4; +var actual = String([a,b,c,d]); + +reportCompare(expected, actual, 'destructuring assignment in let'); + +function f() { + { + let a = 1, [b,c] = [2,3], d = 4; + return String([a,b,c,d]); + } +} + +reportCompare(expected, f(), 'destructuring assignment in let inside func'); diff --git a/js/src/tests/js1_7/regress/regress-416601.js b/js/src/tests/js1_7/regress/regress-416601.js new file mode 100644 index 000000000..197bf29af --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-416601.js @@ -0,0 +1,37 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 416601; +var summary = 'Property cache can be left disabled after exit from a generator or trap handler'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f() + { + with (Math) { + yield 1; + } + } + + var iter = f(); + iter.next(); + iter.close(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-418641.js b/js/src/tests/js1_7/regress/regress-418641.js new file mode 100644 index 000000000..7d194fc32 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-418641.js @@ -0,0 +1,80 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 418641; +var summary = '++ and -- correctness'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function get_pre_check(operand, op) +{ + return "{\n"+ + " "+operand+" = I;\n"+ + " let tmp = "+op+op+operand+";\n"+ + " if ("+operand+" !== Number(I) "+op+" 1)\n"+ + " throw Error('"+op+op+operand+" case 1 for '+uneval(I));\n"+ + " if (tmp !== "+operand+")\n"+ + " throw Error('"+op+op+operand+" case 2 for '+uneval(I));\n"+ + "}\n"; +} + +function get_post_check(operand, op) +{ + return "{\n"+ + " "+operand+" = I;\n"+ + " let tmp = "+operand+op+op+";\n"+ + " if ("+operand+" !== Number(I) "+op+" 1)\n"+ + " throw Error('"+operand+op+op+" case 1 for '+uneval(I));\n"+ + " if (tmp !== Number(I))\n"+ + " throw Error('"+op+op+operand+" case 2 for '+uneval(I));\n"+ + "}\n"; +} + +function get_check_source(operand) +{ + return get_pre_check(operand, '+')+ + get_pre_check(operand, '-')+ + get_post_check(operand, '+')+ + get_post_check(operand, '-'); +} + +var arg_check = Function('I', 'a', get_check_source('a')); +var let_check = Function('I', 'let a;'+get_check_source('a')); +var var_check = Function('I', 'var a;'+get_check_source('a')); + +var my_name; +var my_obj = {}; +var my_index = 0; +var name_check = Function('I', get_check_source('my_name')); +var prop_check = Function('I', get_check_source('my_obj.x')); +var elem_check = Function('I', get_check_source('my_obj[my_index]')); + +var test_values = [0 , 0.5, -0.0, (1 << 30) - 1, 1 - (1 << 30)]; + +for (let i = 0; i != test_values.length; i = i + 1) { + let x = [test_values[i], String(test_values[i])]; + for (let j = 0; j != x.length; j = j + 1) { + try + { + expect = actual = 'No Error'; + let test_value = x[j]; + arg_check(test_value, 0); + let_check(test_value); + var_check(test_value); + name_check(test_value); + prop_check(test_value); + elem_check(test_value); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': ' + i + ', ' + j); + } +} diff --git a/js/src/tests/js1_7/regress/regress-419803.js b/js/src/tests/js1_7/regress/regress-419803.js new file mode 100644 index 000000000..aa4b56aad --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-419803.js @@ -0,0 +1,31 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 419803; +var summary = 'Do not assert: sprop->parent == scope->lastProp'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function g() { for (var i=0; i<2; ++i) yield ({ p: 5, p: 7 }); } + var iter = g(); + print(uneval(iter.next())); + print(uneval(iter.next())); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-452703.js b/js/src/tests/js1_7/regress/regress-452703.js new file mode 100644 index 000000000..e86f2625f --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-452703.js @@ -0,0 +1,19 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 452703; +var summary = 'Do not assert with JIT: rmask(rr)&FpRegs'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +(function() { for(let y in [0,1,2,3,4]) y = NaN; })(); + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_7/regress/regress-452960.js b/js/src/tests/js1_7/regress/regress-452960.js new file mode 100644 index 000000000..8b58fd15a --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-452960.js @@ -0,0 +1,31 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 452960; +var summary = 'Do not assert with JIT: !v.isPrimitive()'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + var f = function(){}; + f.prototype = false; + for (let j=0;j<5;++j) { new f; } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-453049.js b/js/src/tests/js1_7/regress/regress-453049.js new file mode 100644 index 000000000..77ca02a5d --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-453049.js @@ -0,0 +1,29 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 453049; +var summary = 'Do not assert with JIT: (*m != JSVAL_INT) || isInt32(*vp)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + var z = 0; for (let j = 0; j < 5; ++j) { ({p: (-z)}); } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-453051.js b/js/src/tests/js1_7/regress/regress-453051.js new file mode 100644 index 000000000..706f6c7e1 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-453051.js @@ -0,0 +1,29 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 453051; +var summary = 'Do not assert with JIT: !(((*pc == JSOP_GOTO) || (*pc == JSOP_GOTOX)) && (exitType != LOOP_EXIT))'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for (var p in this){} for (let a in [5,6,7]) for (var b=0;b<1;++b) break; + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-453411.js b/js/src/tests/js1_7/regress/regress-453411.js new file mode 100644 index 000000000..d3a490ac4 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-453411.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 453411; +var summary = 'Do not assert with JIT: !cx->executingTrace|!tm->onTrace'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for (var i in (function(){ for (var j=0;j<4;++j) { yield ""; } })()); + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-462071.js b/js/src/tests/js1_7/regress/regress-462071.js new file mode 100644 index 000000000..8282184bb --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-462071.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 462071; +var summary = 'Do not assert: !ti->stackTypeMap.matches(ti_other->stackTypeMap)'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for each (let i in [{}, 0, 0, {}, 0, {}, 0]) { } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-462282.js b/js/src/tests/js1_7/regress/regress-462282.js new file mode 100644 index 000000000..2ba12998a --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-462282.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 462282; +var summary = 'Do not assert: !ti->stackTypeMap.matches(ti_other->stackTypeMap)'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for each (let i in [0, 0, 0, "", 0, 0, "", 0, 0, "", 0]) { } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-462388.js b/js/src/tests/js1_7/regress/regress-462388.js new file mode 100644 index 000000000..b1f03e61e --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-462388.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 462388; +var summary = 'Do not assert: JSVAL_TAG(v) == JSVAL_STRING'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + var c = 0, v; for each (let x in ["",v,v,v]) { for (c=0;c<4;++c) { } } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-462407.js b/js/src/tests/js1_7/regress/regress-462407.js new file mode 100644 index 000000000..236f1aae4 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-462407.js @@ -0,0 +1,19 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 462407; +var summary = 'Do not assert: !ti->stackTypeMap.matches(ti_other->stackTypeMap)'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +(function f() { for each (let i in [0, {}, 0, 1.5, {}, 0, 1.5, 0, 0]) { }})(); + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_7/regress/regress-464403.js b/js/src/tests/js1_7/regress/regress-464403.js new file mode 100644 index 000000000..c26ab44d3 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-464403.js @@ -0,0 +1,32 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 464403; +var summary = 'Do not assert: tm->recorder != NULL'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + print(8); + var u = [print, print, function(){}]; + for each (x in u) for (u.e in [1,1,1,1]); + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-465236.js b/js/src/tests/js1_7/regress/regress-465236.js new file mode 100644 index 000000000..f446c27a9 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-465236.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 465236; +var summary = 'TM: Do not assert: we should have converted to numbers already'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (let j = 0; j < 2; ++j) null <= null; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-465424.js b/js/src/tests/js1_7/regress/regress-465424.js new file mode 100644 index 000000000..dd11d1303 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-465424.js @@ -0,0 +1,30 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 465424; +var summary = 'TM: issue with post-decrement operator'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '0,1,2,3,4,'; + + for (let j=0;j<5;++j) { jj=j; print(actual += '' + (jj--) + ',') } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-465484.js b/js/src/tests/js1_7/regress/regress-465484.js new file mode 100644 index 000000000..3f430e137 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-465484.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 465484; +var summary = 'TM: Do not assert: _allocator.active[FST0] && _fpuStkDepth == -1 || ' + + '!_allocator.active[FST0] && _fpuStkDepth == 0'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for each (let a in [2, 2, 2]) { a %= a; a %= a; } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-465686.js b/js/src/tests/js1_7/regress/regress-465686.js new file mode 100644 index 000000000..8e92a2914 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-465686.js @@ -0,0 +1,35 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 465686; +var summary = 'Do not crash @ tiny_free_list_add_ptr'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for each (let b in [eval, eval, 4, 4]) { + ++b; + for each (b in [(void 0), (void 0), (void 0), 3, (void 0), 3]) { + b ^= b; + for each (var c in [1/0]) { + } + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-469239-01.js b/js/src/tests/js1_7/regress/regress-469239-01.js new file mode 100644 index 000000000..7fa5a7e61 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-469239-01.js @@ -0,0 +1,36 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 469239; +var summary = 'TM: Do not assert: entry->kpc == (jsbytecode*) atoms[index]'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for (let b=0;b<9;++b) { + for each (let h in ['', 3, /x/]) { + for each (c in [[], [], [], /x/]) { + '' + c; + } + } + } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-469239-02.js b/js/src/tests/js1_7/regress/regress-469239-02.js new file mode 100644 index 000000000..4396f83f0 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-469239-02.js @@ -0,0 +1,36 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 469239; +var summary = 'TM: Do not assert: ATOM_IS_STRING(atom)'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for (let b=0;b<9;++b) { + for each (let h in [33, 3, /x/]) { + for each (c in [[], [], [], /x/]) { + '' + c; + } + } + } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-470223.js b/js/src/tests/js1_7/regress/regress-470223.js new file mode 100644 index 000000000..725e22983 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-470223.js @@ -0,0 +1,38 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 470223; +var summary = 'TM: Do not crash @ js_NewObjectWithGivenProto'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + function F(A) { + for (R = [], s = 0; (m = A.indexOf("m", s++)) >= 0; ) + R.push([m]); + for (i = R.length; i--; ) { + let r = R[i]; + if (r[0]); + } + } + F("m"); F("mm"); + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-470388-01.js b/js/src/tests/js1_7/regress/regress-470388-01.js new file mode 100644 index 000000000..ac18f9b07 --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-470388-01.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 470388; +var summary = 'TM: Do not assert: !(fp->flags & JSFRAME_POP_BLOCKS)'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for each (let x in [function(){}, new Boolean(false), function(){}]) {} + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/regress-474771.js b/js/src/tests/js1_7/regress/regress-474771.js new file mode 100644 index 000000000..ae20d2c5d --- /dev/null +++ b/js/src/tests/js1_7/regress/regress-474771.js @@ -0,0 +1,45 @@ +// |reftest| skip-if(Android) +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 474771; +var summary = 'TM: do not halt execution with gczeal, prototype mangling, for..in'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 'PASS'; + + if (typeof gczeal == 'function') + { + gczeal(2); + } + + Object.prototype.q = 3; + for each (let x in [6, 7]) { } print(actual = "PASS"); + + + delete Object.prototype.q; + + if (typeof gczeal == 'function') + { + gczeal(0); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_7/regress/shell.js b/js/src/tests/js1_7/regress/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/js1_7/regress/shell.js |