diff --git a/mozilla/js/tests/js1_8/regress/regress-465567-02.js b/mozilla/js/tests/js1_8/regress/regress-465567-02.js index 25088e23367..363ce67ebd8 100644 --- a/mozilla/js/tests/js1_8/regress/regress-465567-02.js +++ b/mozilla/js/tests/js1_8/regress/regress-465567-02.js @@ -47,7 +47,13 @@ printStatus (summary); jit(true); -for each (e in ['', true, 1, true, 1]) { e = null; if (0) { let e; var e; } } +try +{ + eval("for each (e in ['', true, 1, true, 1]) { e = null; if (0) { let e; var e; } }"); +} +catch(ex) +{ +} jit(false); diff --git a/mozilla/js/tests/js1_8_1/extensions/regress-452498-162.js b/mozilla/js/tests/js1_8_1/extensions/regress-452498-162.js new file mode 100644 index 00000000000..c7b0c997726 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/extensions/regress-452498-162.js @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-162.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #162 From Gary Kwong + +printBugNumber(BUGNUMBER); +printStatus (summary); + +// Assertion failure: !OBJ_GET_CLASS(cx, proto)->getObjectOps, at ../jsobj.cpp:2030 + +jit(true); +__defineGetter__("x3", Function); +undefined = x3; +undefined.prototype = []; +for (var z = 0; z < 4; ++z) { new undefined() } +jit(false); + +reportCompare(expect, actual, summary); diff --git a/mozilla/js/tests/js1_8_1/extensions/regress-452498-193.js b/mozilla/js/tests/js1_8_1/extensions/regress-452498-193.js new file mode 100644 index 00000000000..7d22846c0f1 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/extensions/regress-452498-193.js @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-193.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #193 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: afunbox->parent, at ../jsparse.cpp:1912 + + watch("x", Function); + NaN = uneval({ get \u3056 (){ return undefined } }); + x+=NaN; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/extensions/regress-452498-196.js b/mozilla/js/tests/js1_8_1/extensions/regress-452498-196.js new file mode 100644 index 00000000000..7c7daab5fe6 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/extensions/regress-452498-196.js @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-196.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #196 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: localKind == JSLOCAL_VAR || localKind == JSLOCAL_CONST, at ../jsfun.cpp:916 + + watch("x", Function); + NaN = uneval({ get \u3056 (){ return undefined } }); + x+=NaN; + + reportCompare(expect, actual, summary + ': 1'); + +// Assertion failure: lexdep->isLet(), at ../jsparse.cpp:1900 + + (function (){ + var x; + eval("const x; (function ()x)"); + } + )(); + + reportCompare(expect, actual, summary + ': 2'); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/extensions/regress-452498-224.js b/mozilla/js/tests/js1_8_1/extensions/regress-452498-224.js new file mode 100644 index 00000000000..45829726336 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/extensions/regress-452498-224.js @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-224.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #224 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: cg->flags & TCF_HAS_SHARPS, at ../jsemit.cpp:6439 + ((#0={}) for(x in null)); + + reportCompare(expect, actual, summary + ': 2'); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-052.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-052.js index 81d3a4c71be..b75b2a1cdbd 100644 --- a/mozilla/js/tests/js1_8_1/regress/regress-452498-052.js +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-052.js @@ -70,7 +70,7 @@ function test() // Assertion failure: pnu->pn_cookie == FREE_UPVAR_COOKIE, at ../jsemit.cpp:1815 // In EmitEnterBlock. x has one use, which is pnu here. // pnu is indeed a name, but pnu->pn_cookie is 0. - let (x = 1) { var x; } + try { eval('let (x = 1) { var x; }'); } catch(ex) {} // Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:1992 // atom="x", upvars is empty. diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-082.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-082.js index 0a436393470..ed78c78d44d 100644 --- a/mozilla/js/tests/js1_8_1/regress/regress-452498-082.js +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-082.js @@ -171,10 +171,12 @@ function test() try { - for(let x; - ([,,,] - .toExponential(new Function(), (function(){}))); [] = {}) - for(var [x, x] = * in this.__defineSetter__("", function(){})); + eval( + 'for(let x;' + + ' ([,,,]' + + ' .toExponential(new Function(), (function(){}))); [] = {})' + + ' for(var [x, x] = * in this.__defineSetter__("", function(){}));' + ); } catch(ex) { diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-110.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-110.js index 9a243f17770..774f1c8e2a5 100644 --- a/mozilla/js/tests/js1_8_1/regress/regress-452498-110.js +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-110.js @@ -63,7 +63,7 @@ function test() actual = f + ''; compareSource(expect, actual, 'function f(a) { const b = a; print(++b); return b; }'); - expect = '21'; + expect = '01'; actual = 0; function g(a) { const b = a; print(actual = ++b); return b; } diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-160.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-160.js new file mode 100644 index 00000000000..f15e605df40 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-160.js @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-160.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #160 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:2034 + + (function(){for(var x in (x::window = x for (x in []))[[]]){}})(); + reportCompare(expect, actual, summary + ': 1'); + +// crash [@ js_Interpret] + (eval("(function(){ watch(\"x\", function () { new function ()y } ); const y });"))(); + x = NaN; + reportCompare(expect, actual, summary + ': 2'); + +// Assertion failure: JOF_OPTYPE(op) == JOF_ATOM, at ../jsemit.cpp:5916 + ({ set z(){}, set y x()--x }); + reportCompare(expect, actual, summary + ': 3'); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-168-1.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-168-1.js new file mode 100644 index 00000000000..86ee8b76dc6 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-168-1.js @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-168-1.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #168 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: (fun->u.i.script)->upvarsOffset != 0, at ../jsfun.cpp:1543 + + ( + new Function("const x = (function () { if (1e+81){} else{x} } )" + ))(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-168-2.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-168-2.js new file mode 100644 index 00000000000..5e7a1162d20 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-168-2.js @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-168-2.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #168 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: cg->upvars.lookup(atom), at ../jsemit.cpp:2047 + + for (let x; __defineSetter__; (<{x}> for (x in x))) {} + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-176.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-176.js new file mode 100644 index 00000000000..e883b038870 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-176.js @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-176.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #176 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: pn_arity == PN_FUNC || pn_arity == PN_NAME, at ../jsparse.h:449 + + if(delete( 5 ? [] : (function(){})() )) []; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-178.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-178.js new file mode 100644 index 00000000000..29334c0d72b --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-178.js @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-178.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #178 From Gary Kwong + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Assertion failure: slot < fp2->script->nfixed, at ../jsinterp.cpp:5610 + + eval("with({}) let(x=[])(function(){#2=x})()"); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-181.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-181.js new file mode 100644 index 00000000000..8b6af47ca3a --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-181.js @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Jesse Ruderman + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-181.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #181 From Jesse Ruderman + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 3; + + (function(print) { delete print; })(); print(actual = 3); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-184.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-184.js new file mode 100644 index 00000000000..61d4bd9f592 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-184.js @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Jesse Ruderman + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-184.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #184 From Jesse Ruderman + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '11'; + + const e = 8; print(actual = '' + ((e += 3))); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-185.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-185.js new file mode 100644 index 00000000000..9147bda7305 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-185.js @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Jesse Ruderman + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-185.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #185 From Jesse Ruderman + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 'TypeError: redeclaration of variable e'; + try + { + eval('{ var e = 3; let e = ""; } print(typeof e);'); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-187.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-187.js new file mode 100644 index 00000000000..aacdbaeb28a --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-187.js @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Jesse Ruderman + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-187.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #187 From Jesse Ruderman + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 'SyntaxError: invalid for/in left-hand side'; + try + { + eval('const x; for (x in []);'); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-191.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-191.js new file mode 100644 index 00000000000..155f4017a69 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-191.js @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Brendan Eich + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-191.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #191 From Brendan Eich + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = actual = 'No Error'; + try + { + eval('{ var x; {let x;} }'); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + expect = 'TypeError: redeclaration of let x'; + try + { + eval('{ let x; {var x;} }'); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/regress-452498-192.js b/mozilla/js/tests/js1_8_1/regress/regress-452498-192.js new file mode 100644 index 00000000000..0fccf0aae06 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-452498-192.js @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is JavaScript Engine testing utilities. + * + * The Initial Developer of the Original Code is + * Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Gary Kwong + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var gTestfile = 'regress-452498-192.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 452498; +var summary = 'TM: upvar2 regression tests'; +var actual = ''; +var expect = ''; + +//------- Comment #192 From Brendan Eich + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + with({x: (x -= 0)}){([]); const x } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/slow-n-1.9.1.tests b/mozilla/js/tests/slow-n-1.9.1.tests index 7d998f15404..531b4e864d2 100644 --- a/mozilla/js/tests/slow-n-1.9.1.tests +++ b/mozilla/js/tests/slow-n-1.9.1.tests @@ -21,4 +21,5 @@ js1_8/extensions/regress-476414-01.js js1_8/extensions/regress-476414-02.js js1_8/extensions/regress-476427.js js1_8/regress/regress-464096.js +js1_8_1/regress/regress-452498-168-2.js js1_8_1/trace/regress-451673.js diff --git a/mozilla/js/tests/slow-n-1.9.2.tests b/mozilla/js/tests/slow-n-1.9.2.tests index c1e7b452c8b..2832c53782c 100644 --- a/mozilla/js/tests/slow-n-1.9.2.tests +++ b/mozilla/js/tests/slow-n-1.9.2.tests @@ -20,4 +20,5 @@ js1_8/extensions/regress-476414-01.js js1_8/extensions/regress-476414-02.js js1_8/extensions/regress-476427.js js1_8/regress/regress-464096.js +js1_8_1/regress/regress-452498-168-2.js js1_8_1/trace/regress-451673.js diff --git a/mozilla/js/tests/slow-n.tests b/mozilla/js/tests/slow-n.tests index 0ad0aa77505..c67afe9a4ec 100644 --- a/mozilla/js/tests/slow-n.tests +++ b/mozilla/js/tests/slow-n.tests @@ -20,9 +20,11 @@ js1_5/extensions/regress-350531.js js1_6/extensions/regress-455464-04.js js1_7/extensions/regress-458679.js js1_8/extensions/regress-452913.js +js1_8_1/regress/regress-452498-168-2.js js1_8/extensions/regress-476414-01.js js1_8/extensions/regress-476414-02.js js1_8/extensions/regress-476427.js js1_8/regress/regress-464096.js js1_8/regress/regress-477234.js +js1_8_1/regress/regress-452498-168-2.js js1_8_1/trace/regress-451673.js diff --git a/mozilla/js/tests/spidermonkey-n-1.9.1.tests b/mozilla/js/tests/spidermonkey-n-1.9.1.tests index 3c8fbdbd416..ffe1dca1152 100755 --- a/mozilla/js/tests/spidermonkey-n-1.9.1.tests +++ b/mozilla/js/tests/spidermonkey-n-1.9.1.tests @@ -145,3 +145,5 @@ js1_7/decompilation/regress-371802.js # bug 446026 js1_8/regress/regress-442333-01.js js1_6/Array/regress-320887.js +# bug 452498 upvar2 +js1_7/regress/regress-350387.js diff --git a/mozilla/js/tests/spidermonkey-n-1.9.2.tests b/mozilla/js/tests/spidermonkey-n-1.9.2.tests index 3c8fbdbd416..ffe1dca1152 100644 --- a/mozilla/js/tests/spidermonkey-n-1.9.2.tests +++ b/mozilla/js/tests/spidermonkey-n-1.9.2.tests @@ -145,3 +145,5 @@ js1_7/decompilation/regress-371802.js # bug 446026 js1_8/regress/regress-442333-01.js js1_6/Array/regress-320887.js +# bug 452498 upvar2 +js1_7/regress/regress-350387.js