diff --git a/mozilla/js/tests/js1_7/decompilation/regress-352022.js b/mozilla/js/tests/js1_7/decompilation/regress-352022.js index 02d36d506e4..a7b99070438 100755 --- a/mozilla/js/tests/js1_7/decompilation/regress-352022.js +++ b/mozilla/js/tests/js1_7/decompilation/regress-352022.js @@ -58,12 +58,12 @@ function test() f = function() { g(h) = (delete let (y) 3); } actual = f + ''; expect = 'function () {\n g(h) = ((let (y) 3), true);\n}'; - compareSource(expect, actual, summary); + compareSource(expect, actual, summary + ': 1'); f = function () { g(h) = ((let (y) 3), true);} actual = f + ''; expect = 'function () {\n g(h) = ((let (y) 3), true);\n}'; - compareSource(expect, actual, summary); + compareSource(expect, actual, summary + ': 2'); exitFunc ('test'); } diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-349605.js b/mozilla/js/tests/js1_8_1/decompilation/regress-349605.js index 0ddf65ba9eb..c6e22a2e280 100755 --- a/mozilla/js/tests/js1_8_1/decompilation/regress-349605.js +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-349605.js @@ -56,7 +56,7 @@ function test() { alert(1); for((let(y=3) let(y=4) y); 0; x++) ; alert(6); } expect = 'function () {\n alert(1);\n' + - ' for ((let (y = 3) (let (y = 4) y)); false; x++) {\n' + + ' for (let (y = 3) let (y = 4) y; false; x++) {\n' + ' }\n' + ' alert(6);\n' + '}'; diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-350991.js b/mozilla/js/tests/js1_8_1/decompilation/regress-350991.js new file mode 100755 index 00000000000..9f0d5cd4006 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-350991.js @@ -0,0 +1,87 @@ +/* -*- 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) 2006 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Jesse Ruderman + * Jeff Walden + * + * 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-350991.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 350991; +var summary = 'decompilation of function () { for (let...;...;}} '; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f; + + expect = 'function () {\n for (let (y) 3;;) {\n }\n}'; + try + { + f = eval('(function () { for ((let (y) 3); ;) { } })'); + actual = f + ''; + } + catch(ex) + { + actual = ex + ''; + } + + compareSource(expect, actual, summary); + + expect = 'function () {\n let x = 5;\n while (x-- > 0) {\n' + + ' for (let x = x, q = 5;;) {\n }\n }\n}'; + try + { + f = function() { let x = 5; while (x-- > 0) { for (let x = x, q = 5;;); } } + actual = f + ''; + } + catch(ex) + { + actual = ex + ''; + } + + compareSource(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-352011.js b/mozilla/js/tests/js1_8_1/decompilation/regress-352011.js new file mode 100755 index 00000000000..9c377f77608 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-352011.js @@ -0,0 +1,75 @@ +/* -*- 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) 2006 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Brendan Eich + * 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-352011.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 352011; +var summary = 'decompilation of statements that begin with object literals'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f; + + f = function() { ({}.y = i); } + expect = 'function() { ({}.y = i); }'; + actual = f + ''; + compareSource(expect, actual, summary); + + f = function() { let(x) ({t:x}) } + expect = 'function() { let(x) ({t:x}); }'; + actual = f + ''; + compareSource(expect, actual, summary); + + f = function() { (let(x) {y: z}) } + expect = 'function() { let(x) ({y: z}); }'; + actual = f + ''; + compareSource(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-352022.js b/mozilla/js/tests/js1_8_1/decompilation/regress-352022.js new file mode 100755 index 00000000000..69a5547d72e --- /dev/null +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-352022.js @@ -0,0 +1,69 @@ +/* -*- 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) 2006 + * 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-352022.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 352022; +var summary = 'decompilation of let, delete and parens'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f; + + f = function() { g(h) = (delete let (y) 3); } + actual = f + ''; + expect = 'function () {\n g(h) = (let (y) 3, true);\n}'; + compareSource(expect, actual, summary + ': 1'); + + f = function () { g(h) = ((let (y) 3), true);} + actual = f + ''; + expect = 'function () {\n g(h) = (let (y) 3, true);\n}'; + compareSource(expect, actual, summary + ': 2'); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-352026.js b/mozilla/js/tests/js1_8_1/decompilation/regress-352026.js index dfc5a9c5028..e3bedc144eb 100755 --- a/mozilla/js/tests/js1_8_1/decompilation/regress-352026.js +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-352026.js @@ -61,7 +61,7 @@ function test() compareSource(expect, actual, summary); f = function f(){g((let(a=b)c,d),e)} - expect = 'function f(){g(((let(a=b)c),d),e);}'; + expect = 'function f(){g((let(a=b)c,d),e);}'; actual = f + ''; compareSource(expect, actual, summary); @@ -71,7 +71,7 @@ function test() compareSource(expect, actual, summary); f = function() { (let(s=4){foo:"bar"}) } - expect = 'function() { (let(s=4)({foo:"bar"})); }'; + expect = 'function() { let(s=4)({foo:"bar"}); }'; actual = f + ''; compareSource(expect, actual, summary); diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-352609.js b/mozilla/js/tests/js1_8_1/decompilation/regress-352609.js new file mode 100755 index 00000000000..58a4960d311 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-352609.js @@ -0,0 +1,90 @@ +/* -*- 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) 2006 + * 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-352609.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 352609; +var summary = 'decompilation of |let| expression for |is not a function| error'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = /TypeError: 0 is not a function/; + try + { + [let (x = 3, y = 4) x].map(0); + } + catch(ex) + { + actual = ex + ''; + } + reportMatch(expect, actual, '[let (x = 3, y = 4) x].map(0)'); + + expect = /TypeError: (p.z = \[let \(x = 3, y = 4\) x\]|.*Array.*) is not a function/; + try + { + var p = {}; (p.z = [let (x = 3, y = 4) x])(); + } + catch(ex) + { + actual = ex + ''; + } + reportMatch(expect, actual, 'p = {}; (p.z = [let (x = 3, y = 4) x])()'); + + expect = /TypeError: (p.z = let \(x\) x|.*Undefined.*) is not a function/; + try + { + var p = {}; (p.z = let(x) x)() + } + catch(ex) + { + actual = ex + ''; + } + reportMatch(expect, actual, 'p = {}; (p.z = let(x) x)()'); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/decompilation/regress-353249.js b/mozilla/js/tests/js1_8_1/decompilation/regress-353249.js new file mode 100755 index 00000000000..242aead45ae --- /dev/null +++ b/mozilla/js/tests/js1_8_1/decompilation/regress-353249.js @@ -0,0 +1,67 @@ +/* -*- 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) 2006 + * 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-353249.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 353249; +var summary = 'regression test for bug 353249'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f = (function () { let (x) .(1) < let (z) eval('3'); + for (x in this) {} }); + + expect = 'function () { let (x) .((1)) < (let (z) eval("3")); ' + + 'for (x in this) {} }'; + actual = f + ''; + compareSource(expect, actual, summary); + + // do not crash() + f(); + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/browser.js b/mozilla/js/tests/js1_8_1/regress/browser.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mozilla/js/tests/js1_8_1/regress/regress-420399.js b/mozilla/js/tests/js1_8_1/regress/regress-420399.js new file mode 100755 index 00000000000..8899c9ffe3b --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/regress-420399.js @@ -0,0 +1,69 @@ +/* -*- 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) 2007 + * 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-420399.js'; +//----------------------------------------------------------------------------- +var BUGNUMBER = 420399; +var summary = 'Let expression error involving undefined'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = /TypeError: let \(a = undefined\) a (is undefined|has no properties)/; + try + { + (let (a=undefined) a).b = 3; + } + catch(ex) + { + actual = ex + ''; + } + + reportMatch(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/mozilla/js/tests/js1_8_1/regress/shell.js b/mozilla/js/tests/js1_8_1/regress/shell.js new file mode 100644 index 00000000000..448e85acfe6 --- /dev/null +++ b/mozilla/js/tests/js1_8_1/regress/shell.js @@ -0,0 +1 @@ +gTestsubsuite='regress'; diff --git a/mozilla/js/tests/spidermonkey-n-1.9.1.tests b/mozilla/js/tests/spidermonkey-n-1.9.1.tests index a49cf471819..a349ad6c27c 100755 --- a/mozilla/js/tests/spidermonkey-n-1.9.1.tests +++ b/mozilla/js/tests/spidermonkey-n-1.9.1.tests @@ -134,3 +134,11 @@ js1_7/decompilation/regress-352026.js # https://bugzilla.mozilla.org/show_bug.cgi?id=458851#c7 js1_5/extensions/regress-437288-01.js js1_5/decompilation/regress-437288-02.js +# more decompilation changes, bug 461233 +js1_7/block/regress-352609.js +js1_7/decompilation/regress-349602.js +js1_7/decompilation/regress-350991.js +js1_7/decompilation/regress-352011.js +js1_7/decompilation/regress-352022.js +js1_7/extensions/regress-353249.js +js1_7/regress/regress-420399.js