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_5/extensions | |
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_5/extensions')
207 files changed, 12458 insertions, 0 deletions
diff --git a/js/src/tests/js1_5/extensions/browser.js b/js/src/tests/js1_5/extensions/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/js1_5/extensions/browser.js diff --git a/js/src/tests/js1_5/extensions/catchguard-001-n.js b/js/src/tests/js1_5/extensions/catchguard-001-n.js new file mode 100644 index 000000000..a0ff8d40c --- /dev/null +++ b/js/src/tests/js1_5/extensions/catchguard-001-n.js @@ -0,0 +1,43 @@ +/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- + * 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/. */ + + +DESCRIPTION = " the non-guarded catch should HAVE to appear last"; +EXPECTED = "error"; + +test(); + +function test() +{ + enterFunc ("test"); + + var EXCEPTION_DATA = "String exception"; + var e; + + printStatus ("Catchguard syntax negative test."); + + try + { + throw EXCEPTION_DATA; + } + catch (e) /* the non-guarded catch should HAVE to appear last */ + { + + } + catch (e if true) + { + + } + catch (e if false) + { + + } + + reportCompare('PASS', 'FAIL', + "Illegally constructed catchguard should have thrown " + + "an exception."); + + exitFunc ("test"); +} diff --git a/js/src/tests/js1_5/extensions/catchguard-001.js b/js/src/tests/js1_5/extensions/catchguard-001.js new file mode 100644 index 000000000..d79f88b3f --- /dev/null +++ b/js/src/tests/js1_5/extensions/catchguard-001.js @@ -0,0 +1,47 @@ +/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- + * 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/. */ + + +test(); + +function test() +{ + enterFunc ("test"); + + var EXCEPTION_DATA = "String exception"; + var e = "foo"; + var caught = false; + + printStatus ("Basic catchguard test."); + + try + { + throw EXCEPTION_DATA; + } + catch (e if true) + { + caught = true; + e = "this change should not propagate outside of this scope"; + } + catch (e if false) + { + reportCompare('PASS', 'FAIL', "Catch block (e if false) should not have executed."); + } + catch (e) + { + reportCompare('PASS', 'FAIL', "Catch block (e) should not have executed."); + } + + if (!caught) + reportCompare('PASS', 'FAIL', "Exception was never caught."); + + if (e != "foo") + reportCompare('PASS', 'FAIL', "Exception data modified inside catch() scope should " + + "not be visible in the function scope (e = '" + + e + "'.)"); + + reportCompare('PASS', 'PASS', ''); + exitFunc ("test"); +} diff --git a/js/src/tests/js1_5/extensions/catchguard-002.js b/js/src/tests/js1_5/extensions/catchguard-002.js new file mode 100644 index 000000000..a6068f6fc --- /dev/null +++ b/js/src/tests/js1_5/extensions/catchguard-002.js @@ -0,0 +1,43 @@ +/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- + * 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/. */ + + +test(); + +function test() +{ + enterFunc ("test"); + + var EXCEPTION_DATA = "String exception"; + var e; + var caught = false; + + printStatus ("Basic catchguard test."); + + try + { + throw EXCEPTION_DATA; + } + catch (e if true) + { + caught = true; + } + catch (e if true) + { + reportCompare('PASS', 'FAIL', + "Second (e if true) catch block should not have executed."); + } + catch (e) + { + reportCompare('PASS', 'FAIL', "Catch block (e) should not have executed."); + } + + if (!caught) + reportCompare('PASS', 'FAIL', "Exception was never caught."); + + reportCompare('PASS', 'PASS', 'Basic catchguard test'); + + exitFunc ("test"); +} diff --git a/js/src/tests/js1_5/extensions/catchguard-003.js b/js/src/tests/js1_5/extensions/catchguard-003.js new file mode 100644 index 000000000..4aee3a21d --- /dev/null +++ b/js/src/tests/js1_5/extensions/catchguard-003.js @@ -0,0 +1,58 @@ +/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- + * 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/. */ + + +test(); + +function test() +{ + enterFunc ("test"); + + var EXCEPTION_DATA = "String exception"; + var e = "foo", x = "foo"; + var caught = false; + + printStatus ("Catchguard 'Common Scope' test."); + + try + { + throw EXCEPTION_DATA; + } + catch (e if ((x = 1) && false)) + { + reportCompare('PASS', 'FAIL', + "Catch block (e if ((x = 1) && false) should not " + + "have executed."); + } + catch (e if (x == 1)) + { + caught = true; + } + catch (e) + { + reportCompare('PASS', 'FAIL', + "Same scope should be used across all catchguards."); + } + + if (!caught) + reportCompare('PASS', 'FAIL', + "Exception was never caught."); + + if (e != "foo") + reportCompare('PASS', 'FAIL', + "Exception data modified inside catch() scope should " + + "not be visible in the function scope (e ='" + + e + "'.)"); + + if (x != 1) + reportCompare('PASS', 'FAIL', + "Data modified in 'catchguard expression' should " + + "be visible in the function scope (x = '" + + x + "'.)"); + + reportCompare('PASS', 'PASS', 'Catchguard Common Scope test'); + + exitFunc ("test"); +} diff --git a/js/src/tests/js1_5/extensions/getset-001.js b/js/src/tests/js1_5/extensions/getset-001.js new file mode 100644 index 000000000..29191cdfe --- /dev/null +++ b/js/src/tests/js1_5/extensions/getset-001.js @@ -0,0 +1,51 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- + * 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/. */ + + +function TestObject () +{ + /* A warm, dry place for properties and methods to live */ +} + +TestObject.prototype._y = "<initial y>"; + +Object.defineProperty(TestObject.prototype, "y", +{ + enumerable: true, configurable: true, + get: function get_y () + { + var rv; + if (typeof this._y == "string") + rv = "got " + this._y; + else + rv = this._y; + return rv; + }, + set: function set_y (newVal) { this._y = newVal; } +}); + + +test(new TestObject()); + +function test(t) +{ + enterFunc ("test"); + + printStatus ("Basic Getter/ Setter test"); + reportCompare ("<initial y>", t._y, "y prototype check"); + + reportCompare ("got <initial y>", t.y, "y getter, before set"); + + t.y = "new y"; + reportCompare ("got new y", t.y, "y getter, after set"); + + t.y = 2; + reportCompare (2, t.y, "y getter, after numeric set"); + + var d = new Date(); + t.y = d; + reportCompare (d, t.y, "y getter, after date set"); + +} diff --git a/js/src/tests/js1_5/extensions/getset-003.js b/js/src/tests/js1_5/extensions/getset-003.js new file mode 100644 index 000000000..7aec7fcfd --- /dev/null +++ b/js/src/tests/js1_5/extensions/getset-003.js @@ -0,0 +1,189 @@ +/* -*- 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/. */ + +/* + * Date: 14 April 2001 + * + * SUMMARY: Testing obj.prop getter/setter + * Note: this is a non-ECMA extension to the language. + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = '(none)'; +var summary = 'Testing obj.prop getter/setter'; +var statprefix = 'Status: '; +var status = ''; +var statusitems = [ ]; +var actual = ''; +var actualvalues = [ ]; +var expect= ''; +var expectedvalues = [ ]; +var cnDEFAULT = 'default name'; +var cnFRED = 'Fred'; +var obj = {}; +var obj2 = {}; +var s = ''; + + +// SECTION1: define getter/setter directly on an object (not its prototype) +obj = new Object(); +obj.nameSETS = 0; +obj.nameGETS = 0; +Object.defineProperty(obj, "name", +{ + enumerable: true, configurable: true, + set: function(newValue) {this._name=newValue; this.nameSETS++;}, + get: function() {this.nameGETS++; return this._name;} +}); + + status = 'In SECTION1 of test after 0 sets, 0 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,0]; +addThis(); + +s = obj.name; +status = 'In SECTION1 of test after 0 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION1 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION1 of test after 2 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,2]; +addThis(); + + +// SECTION2: define getter/setter in Object.prototype +Object.prototype.nameSETS = 0; +Object.prototype.nameGETS = 0; +Object.defineProperty(Object.prototype, "name", +{ + enumerable: true, configurable: true, + set: function(newValue) {this._name=newValue; this.nameSETS++;}, + get: function() {this.nameGETS++; return this._name;} +}); + + obj = new Object(); +status = 'In SECTION2 of test after 0 sets, 0 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,0]; +addThis(); + +s = obj.name; +status = 'In SECTION2 of test after 0 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION2 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION2 of test after 2 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,2]; +addThis(); + + +// SECTION 3: define getter/setter in prototype of user-defined constructor +function TestObject() +{ +} +TestObject.prototype.nameSETS = 0; +TestObject.prototype.nameGETS = 0; +Object.defineProperty(TestObject.prototype, "name", +{ + enumerable: true, configurable: true, + set: function(newValue) {this._name=newValue; this.nameSETS++;}, + get: function() {this.nameGETS++; return this._name;} +}); + TestObject.prototype.name = cnDEFAULT; + +obj = new TestObject(); +status = 'In SECTION3 of test after 1 set, 0 gets'; // (we set a default value in the prototype) +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,0]; +addThis(); + +s = obj.name; +status = 'In SECTION3 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION3 of test after 2 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION3 of test after 3 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [3,2]; +addThis(); + +obj2 = new TestObject(); +status = 'obj2 = new TestObject() after 1 set, 0 gets'; +actual = [obj2.nameSETS,obj2.nameGETS]; +expect = [1,0]; // we set a default value in the prototype - +addThis(); + +// Use both obj and obj2 - +obj2.name = obj.name + obj2.name; +status = 'obj2 = new TestObject() after 2 sets, 1 get'; +actual = [obj2.nameSETS,obj2.nameGETS]; +expect = [2,1]; +addThis(); + +status = 'In SECTION3 of test after 3 sets, 3 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [3,3]; // we left off at [3,2] above - +addThis(); + + +//--------------------------------------------------------------------------------- +test(); +//--------------------------------------------------------------------------------- + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual.toString(); + expectedvalues[UBound] = expect.toString(); + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); + } + + exitFunc ('test'); +} + + +function getStatus(i) +{ + return statprefix + statusitems[i]; +} diff --git a/js/src/tests/js1_5/extensions/getset-004.js b/js/src/tests/js1_5/extensions/getset-004.js new file mode 100644 index 000000000..30e134819 --- /dev/null +++ b/js/src/tests/js1_5/extensions/getset-004.js @@ -0,0 +1,177 @@ +/* -*- 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/. */ + +/* + * Date: 14 April 2001 + * + * SUMMARY: Testing obj.__defineSetter__(), obj.__defineGetter__() + * Note: this is a non-ECMA language extension + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = '(none)'; +var summary = 'Testing obj.__defineSetter__(), obj.__defineGetter__()'; +var statprefix = 'Status: '; +var status = ''; +var statusitems = [ ]; +var actual = ''; +var actualvalues = [ ]; +var expect= ''; +var expectedvalues = [ ]; +var cnDEFAULT = 'default name'; +var cnFRED = 'Fred'; +var obj = {}; +var obj2 = {}; +var s = ''; + + +// SECTION1: define getter/setter directly on an object (not its prototype) +obj = new Object(); +obj.nameSETS = 0; +obj.nameGETS = 0; +obj.__defineSetter__('name', function(newValue) {this._name=newValue; this.nameSETS++;}); +obj.__defineGetter__('name', function() {this.nameGETS++; return this._name;}); + +status = 'In SECTION1 of test after 0 sets, 0 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,0]; +addThis(); + +s = obj.name; +status = 'In SECTION1 of test after 0 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION1 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION1 of test after 2 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,2]; +addThis(); + + +// SECTION2: define getter/setter in Object.prototype +Object.prototype.nameSETS = 0; +Object.prototype.nameGETS = 0; +Object.prototype.__defineSetter__('name', function(newValue) {this._name=newValue; this.nameSETS++;}); +Object.prototype.__defineGetter__('name', function() {this.nameGETS++; return this._name;}); + +obj = new Object(); +status = 'In SECTION2 of test after 0 sets, 0 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,0]; +addThis(); + +s = obj.name; +status = 'In SECTION2 of test after 0 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION2 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION2 of test after 2 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,2]; +addThis(); + + +// SECTION 3: define getter/setter in prototype of user-defined constructor +function TestObject() +{ +} +TestObject.prototype.nameSETS = 0; +TestObject.prototype.nameGETS = 0; +TestObject.prototype.__defineSetter__('name', function(newValue) {this._name=newValue; this.nameSETS++;}); +TestObject.prototype.__defineGetter__('name', function() {this.nameGETS++; return this._name;}); +TestObject.prototype.name = cnDEFAULT; + +obj = new TestObject(); +status = 'In SECTION3 of test after 1 set, 0 gets'; // (we set a default value in the prototype) +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,0]; +addThis(); + +s = obj.name; +status = 'In SECTION3 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION3 of test after 2 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION3 of test after 3 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [3,2]; +addThis(); + +obj2 = new TestObject(); +status = 'obj2 = new TestObject() after 1 set, 0 gets'; +actual = [obj2.nameSETS,obj2.nameGETS]; +expect = [1,0]; // we set a default value in the prototype - +addThis(); + +// Use both obj and obj2 - +obj2.name = obj.name + obj2.name; +status = 'obj2 = new TestObject() after 2 sets, 1 get'; +actual = [obj2.nameSETS,obj2.nameGETS]; +expect = [2,1]; +addThis(); + +status = 'In SECTION3 of test after 3 sets, 3 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [3,3]; // we left off at [3,2] above - +addThis(); + + +//--------------------------------------------------------------------------------- +test(); +//--------------------------------------------------------------------------------- + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual.toString(); + expectedvalues[UBound] = expect.toString(); + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); + } + + exitFunc ('test'); +} + + +function getStatus(i) +{ + return statprefix + statusitems[i]; +} diff --git a/js/src/tests/js1_5/extensions/getset-005.js b/js/src/tests/js1_5/extensions/getset-005.js new file mode 100644 index 000000000..da55105de --- /dev/null +++ b/js/src/tests/js1_5/extensions/getset-005.js @@ -0,0 +1,186 @@ +/* -*- 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/. */ + +/* + * Date: 14 April 2001 + * + * SUMMARY: Testing obj.__defineSetter__(), obj.__defineGetter__() + * Note: this is a non-ECMA language extension + * + * This test is the same as getset-004.js, except that here we + * store the getter/setter functions in global variables. + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = '(none)'; +var summary = 'Testing obj.__defineSetter__(), obj.__defineGetter__()'; +var statprefix = 'Status: '; +var status = ''; +var statusitems = [ ]; +var actual = ''; +var actualvalues = [ ]; +var expect= ''; +var expectedvalues = [ ]; +var cnName = 'name'; +var cnDEFAULT = 'default name'; +var cnFRED = 'Fred'; +var obj = {}; +var obj2 = {}; +var s = ''; + + +// The getter/setter functions we'll use in all three sections below - +var cnNameSetter = function(newValue) {this._name=newValue; this.nameSETS++;}; +var cnNameGetter = function() {this.nameGETS++; return this._name;}; + + +// SECTION1: define getter/setter directly on an object (not its prototype) +obj = new Object(); +obj.nameSETS = 0; +obj.nameGETS = 0; +obj.__defineSetter__(cnName, cnNameSetter); +obj.__defineGetter__(cnName, cnNameGetter); + +status = 'In SECTION1 of test after 0 sets, 0 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,0]; +addThis(); + +s = obj.name; +status = 'In SECTION1 of test after 0 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION1 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION1 of test after 2 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,2]; +addThis(); + + +// SECTION2: define getter/setter in Object.prototype +Object.prototype.nameSETS = 0; +Object.prototype.nameGETS = 0; +Object.prototype.__defineSetter__(cnName, cnNameSetter); +Object.prototype.__defineGetter__(cnName, cnNameGetter); + +obj = new Object(); +status = 'In SECTION2 of test after 0 sets, 0 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,0]; +addThis(); + +s = obj.name; +status = 'In SECTION2 of test after 0 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [0,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION2 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION2 of test after 2 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,2]; +addThis(); + + +// SECTION 3: define getter/setter in prototype of user-defined constructor +function TestObject() +{ +} +TestObject.prototype.nameSETS = 0; +TestObject.prototype.nameGETS = 0; +TestObject.prototype.__defineSetter__(cnName, cnNameSetter); +TestObject.prototype.__defineGetter__(cnName, cnNameGetter); +TestObject.prototype.name = cnDEFAULT; + +obj = new TestObject(); +status = 'In SECTION3 of test after 1 set, 0 gets'; // (we set a default value in the prototype) +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,0]; +addThis(); + +s = obj.name; +status = 'In SECTION3 of test after 1 set, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [1,1]; +addThis(); + +obj.name = cnFRED; +status = 'In SECTION3 of test after 2 sets, 1 get'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [2,1]; +addThis(); + +obj.name = obj.name; +status = 'In SECTION3 of test after 3 sets, 2 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [3,2]; +addThis(); + +obj2 = new TestObject(); +status = 'obj2 = new TestObject() after 1 set, 0 gets'; +actual = [obj2.nameSETS,obj2.nameGETS]; +expect = [1,0]; // we set a default value in the prototype - +addThis(); + +// Use both obj and obj2 - +obj2.name = obj.name + obj2.name; +status = 'obj2 = new TestObject() after 2 sets, 1 get'; +actual = [obj2.nameSETS,obj2.nameGETS]; +expect = [2,1]; +addThis(); + +status = 'In SECTION3 of test after 3 sets, 3 gets'; +actual = [obj.nameSETS,obj.nameGETS]; +expect = [3,3]; // we left off at [3,2] above - +addThis(); + + +//--------------------------------------------------------------------------------- +test(); +//--------------------------------------------------------------------------------- + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual.toString(); + expectedvalues[UBound] = expect.toString(); + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); + } + + exitFunc ('test'); +} + + +function getStatus(i) +{ + return statprefix + statusitems[i]; +} diff --git a/js/src/tests/js1_5/extensions/getset-006.js b/js/src/tests/js1_5/extensions/getset-006.js new file mode 100644 index 000000000..b6ece3a77 --- /dev/null +++ b/js/src/tests/js1_5/extensions/getset-006.js @@ -0,0 +1,160 @@ +/* -*- 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/. */ + +/* + * Date: 14 April 2001 + * + * SUMMARY: Testing obj.__lookupGetter__(), obj.__lookupSetter__() + * See http://bugzilla.mozilla.org/show_bug.cgi?id=71992 + * + * Brendan: "I see no need to provide more than the minimum: + * o.__lookupGetter__('p') returns the getter function for o.p, + * or undefined if o.p has no getter. Users can wrap and layer." + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 71992; +var summary = 'Testing obj.__lookupGetter__(), obj.__lookupSetter__()'; +var statprefix = 'Status: '; +var status = ''; +var statusitems = [ ]; +var actual = ''; +var actualvalues = [ ]; +var expect= ''; +var expectedvalues = [ ]; +var cnName = 'name'; +var cnColor = 'color'; +var cnNonExistingProp = 'ASDF_#_$%'; +var cnDEFAULT = 'default name'; +var cnFRED = 'Fred'; +var cnRED = 'red'; +var obj = {}; +var obj2 = {}; +var s; + + +// The only setter and getter functions we'll use in the three sections below - +var cnNameSetter = function(newValue) {this._name=newValue; this.nameSETS++;}; +var cnNameGetter = function() {this.nameGETS++; return this._name;}; + + + +// SECTION1: define getter/setter directly on an object (not its prototype) +obj = new Object(); +obj.nameSETS = 0; +obj.nameGETS = 0; +obj.__defineSetter__(cnName, cnNameSetter); +obj.__defineGetter__(cnName, cnNameGetter); +obj.name = cnFRED; +obj.color = cnRED; + +status ='In SECTION1 of test; looking up extant getter/setter'; +actual = [obj.__lookupSetter__(cnName), obj.__lookupGetter__(cnName)]; +expect = [cnNameSetter, cnNameGetter]; +addThis(); + +status = 'In SECTION1 of test; looking up nonexistent getter/setter'; +actual = [obj.__lookupSetter__(cnColor), obj.__lookupGetter__(cnColor)]; +expect = [undefined, undefined]; +addThis(); + +status = 'In SECTION1 of test; looking up getter/setter on nonexistent property'; +actual = [obj.__lookupSetter__(cnNonExistingProp), obj.__lookupGetter__(cnNonExistingProp)]; +expect = [undefined, undefined]; +addThis(); + + + +// SECTION2: define getter/setter in Object.prototype +Object.prototype.nameSETS = 0; +Object.prototype.nameGETS = 0; +Object.prototype.__defineSetter__(cnName, cnNameSetter); +Object.prototype.__defineGetter__(cnName, cnNameGetter); + +obj = new Object(); +obj.name = cnFRED; +obj.color = cnRED; + +status = 'In SECTION2 of test looking up extant getter/setter'; +actual = [obj.__lookupSetter__(cnName), obj.__lookupGetter__(cnName)]; +expect = [cnNameSetter, cnNameGetter]; +addThis(); + +status = 'In SECTION2 of test; looking up nonexistent getter/setter'; +actual = [obj.__lookupSetter__(cnColor), obj.__lookupGetter__(cnColor)]; +expect = [undefined, undefined]; +addThis(); + +status = 'In SECTION2 of test; looking up getter/setter on nonexistent property'; +actual = [obj.__lookupSetter__(cnNonExistingProp), obj.__lookupGetter__(cnNonExistingProp)]; +expect = [undefined, undefined]; +addThis(); + + + +// SECTION 3: define getter/setter in prototype of user-defined constructor +function TestObject() +{ +} +TestObject.prototype.nameSETS = 0; +TestObject.prototype.nameGETS = 0; +TestObject.prototype.__defineSetter__(cnName, cnNameSetter); +TestObject.prototype.__defineGetter__(cnName, cnNameGetter); +TestObject.prototype.name = cnDEFAULT; + +obj = new TestObject(); +obj.name = cnFRED; +obj.color = cnRED; + +status = 'In SECTION3 of test looking up extant getter/setter'; +actual = [obj.__lookupSetter__(cnName), obj.__lookupGetter__(cnName)]; +expect = [cnNameSetter, cnNameGetter]; +addThis(); + +status = 'In SECTION3 of test; looking up nonexistent getter/setter'; +actual = [obj.__lookupSetter__(cnColor), obj.__lookupGetter__(cnColor)]; +expect = [undefined, undefined]; +addThis(); + +status = 'In SECTION3 of test; looking up getter/setter on nonexistent property'; +actual = [obj.__lookupSetter__(cnNonExistingProp), obj.__lookupGetter__(cnNonExistingProp)]; +expect = [undefined, undefined]; +addThis(); + + + +//--------------------------------------------------------------------------------- +test(); +//--------------------------------------------------------------------------------- + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual.toString(); + expectedvalues[UBound] = expect.toString(); + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], getStatus(i)); + } + + exitFunc ('test'); +} + + +function getStatus(i) +{ + return statprefix + statusitems[i]; +} diff --git a/js/src/tests/js1_5/extensions/regress-104077.js b/js/src/tests/js1_5/extensions/regress-104077.js new file mode 100644 index 000000000..218459de0 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-104077.js @@ -0,0 +1,196 @@ +/* -*- 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/. */ + +/* + * + * Date: 10 October 2001 + * SUMMARY: Regression test for Bugzilla bug 104077 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=104077 + * "JS crash: with/finally/return" + * + * Also http://bugzilla.mozilla.org/show_bug.cgi?id=120571 + * "JS crash: try/catch/continue." + * + * SpiderMonkey crashed on this code - it shouldn't. + * + * NOTE: the finally-blocks below should execute even if their try-blocks + * have return or throw statements in them: + * + * ------- Additional Comment #76 From Mike Shaver 2001-12-07 01:21 ------- + * finally trumps return, and all other control-flow constructs that cause + * program execution to jump out of the try block: throw, break, etc. Once you + * enter a try block, you will execute the finally block after leaving the try, + * regardless of what happens to make you leave the try. + * + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 104077; +var summary = "Just testing that we don't crash on with/finally/return -"; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; + + +function addValues_3(obj) +{ + var sum = 0; + + with (obj) + { + try + { + sum = arg1 + arg2; + with (arg3) + { + while (sum < 10) + { + try + { + if (sum > 5) + return sum; + sum += 1; + } + catch (e) + { + sum += 1; + } + } + } + } + finally + { + try + { + sum +=1; + print("In finally block of addValues_3() function: sum = " + sum); + } + catch (e if e == 42) + { + sum +=1; + print('In finally catch block of addValues_3() function: sum = ' + sum + ', e = ' + e); + } + finally + { + sum +=1; + print("In finally finally block of addValues_3() function: sum = " + sum); + return sum; + } + } + } +} + +status = inSection(9); +obj = new Object(); +obj.arg1 = 1; +obj.arg2 = 2; +obj.arg3 = new Object(); +obj.arg3.a = 10; +obj.arg3.b = 20; +actual = addValues_3(obj); +expect = 8; +captureThis(); + + + + +function addValues_4(obj) +{ + var sum = 0; + + with (obj) + { + try + { + sum = arg1 + arg2; + with (arg3) + { + while (sum < 10) + { + try + { + if (sum > 5) + return sum; + sum += 1; + } + catch (e) + { + sum += 1; + } + } + } + } + finally + { + try + { + sum += 1; + print("In finally block of addValues_4() function: sum = " + sum); + } + catch (e if e == 42) + { + sum += 1; + print("In 1st finally catch block of addValues_4() function: sum = " + sum + ", e = " + e); + } + catch (e if e == 43) + { + sum += 1; + print("In 2nd finally catch block of addValues_4() function: sum = " + sum + ", e = " + e); + } + finally + { + sum += 1; + print("In finally finally block of addValues_4() function: sum = " + sum); + return sum; + } + } + } +} + +status = inSection(10); +obj = new Object(); +obj.arg1 = 1; +obj.arg2 = 2; +obj.arg3 = new Object(); +obj.arg3.a = 10; +obj.arg3.b = 20; +actual = addValues_4(obj); +expect = 8; +captureThis(); + + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + + +function captureThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-178722.js b/js/src/tests/js1_5/extensions/regress-178722.js new file mode 100644 index 000000000..428bcf79d --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-178722.js @@ -0,0 +1,93 @@ +/* -*- 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/. */ + +/* + * + * Date: 06 November 2002 + * SUMMARY: arr.sort() should not output |undefined| when |arr| is empty + * See http://bugzilla.mozilla.org/show_bug.cgi?id=178722 + * + * ECMA-262 Ed.3: 15.4.4.11 Array.prototype.sort (comparefn) + * + * 1. Call the [[Get]] method of this object with argument "length". + * 2. Call ToUint32(Result(1)). + * 3. Perform an implementation-dependent sequence of calls to the [[Get]], + * [[Put]], and [[Delete]] methods of this object, etc. etc. + * 4. Return this object. + * + * + * Note that sort() is done in-place on |arr|. In other words, sort() is a + * "destructive" method rather than a "functional" method. The return value + * of |arr.sort()| and |arr| are the same object. + * + * If |arr| is an empty array, the return value of |arr.sort()| should be + * an empty array, not the value |undefined| as was occurring in bug 178722. + * + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 178722; +var summary = 'arr.sort() should not output |undefined| when |arr| is empty'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; +var arr; + + +// create empty array or pseudo-array objects in various ways +function f () {return arguments}; +var arr5 = f(); +arr5.__proto__ = Array.prototype; + + +status = inSection(5); +arr = arr5.sort(); +actual = arr instanceof Array && arr.length === 0 && arr === arr5; +expect = true; +addThis(); + + +// now do the same thing, with non-default sorting: +function g() {return 1;} + +status = inSection('5a'); +arr = arr5.sort(g); +actual = arr instanceof Array && arr.length === 0 && arr === arr5; +expect = true; +addThis(); + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc('test'); + printBugNumber(BUGNUMBER); + printStatus(summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-192465.js b/js/src/tests/js1_5/extensions/regress-192465.js new file mode 100644 index 000000000..4999a2408 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-192465.js @@ -0,0 +1,123 @@ +/* -*- 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/. */ + +/* + * + * Date: 10 February 2003 + * SUMMARY: Object.toSource() recursion should check stack overflow + * + * See http://bugzilla.mozilla.org/show_bug.cgi?id=192465 + * + * MODIFIED: 27 February 2003 + * + * We are adding an early return to this testcase, since it is causing + * big problems on Linux RedHat8! For a discussion of this issue, see + * http://bugzilla.mozilla.org/show_bug.cgi?id=174341#c24 and following. + * + * + * MODIFIED: 20 March 2003 + * + * Removed the early return and changed |N| below from 1000 to 90. + * Note |make_deep_nest(N)| returns an object graph of length N(N+1). + * So the graph has now been reduced from 1,001,000 to 8190. + * + * With this reduction, the bug still manifests on my WinNT and Linux + * boxes (crash due to stack overflow). So the testcase is again of use + * on those boxes. At the same time, Linux RedHat8 boxes can now run + * the test in a reasonable amount of time. + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 192465; +var summary = 'Object.toSource() recursion should check stack overflow'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; + + +/* + * We're just testing that this script will compile and run. + * Set both |actual| and |expect| to a dummy value. + */ +status = inSection(1); +var N = 90; +try +{ + make_deep_nest(N); +} +catch (e) +{ + // An exception is OK, as the runtime can throw one in response to too deep + // recursion. We haven't crashed; good! Continue on to set the dummy values - +} +actual = 1; +expect = 1; +addThis(); + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +/* + * EXAMPLE: + * + * If the global variable |N| is 2, then for |level| == 0, 1, 2, the return + * value of this function will be toSource() of these objects, respectively: + * + * {next:{next:END}} + * {next:{next:{next:{next:END}}}} + * {next:{next:{next:{next:{next:{next:END}}}}}} + * + */ +function make_deep_nest(level) +{ + var head = {}; + var cursor = head; + + for (var i=0; i!=N; ++i) + { + cursor.next = {}; + cursor = cursor.next; + } + + cursor.toSource = function() + { + if (level != 0) + return make_deep_nest(level - 1); + return "END"; + } + + return head.toSource(); +} + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc('test'); + printBugNumber(BUGNUMBER); + printStatus(summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-225831.js b/js/src/tests/js1_5/extensions/regress-225831.js new file mode 100644 index 000000000..3330c7178 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-225831.js @@ -0,0 +1,162 @@ +/* -*- 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/. */ + +/* + * + * Date: 15 Nov 2003 + * SUMMARY: Stressing the byte code generator + * + * See http://bugzilla.mozilla.org/show_bug.cgi?id=225831 + * + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 225831; +var summary = 'Stressing the byte code generator'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; + + +function f() { return {x: 0}; } + +var N = 300; +var a = new Array(N + 1); +a[N] = 10; +a[0] = 100; + + +status = inSection(1); + +// build string of the form ++(a[++f().x + ++f().x + ... + ++f().x]) which +// gives ++a[N] +var str = "".concat("++(a[", repeat_str("++f().x + ", (N - 1)), "++f().x])"); + +// Use Script constructor instead of simple eval to test Rhino optimizer mode +// because in Rhino, eval always uses interpreted mode. +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + var script = new Script(str); + script(); + + actual = a[N]; + expect = 11; +} +addThis(); + +status = inSection(2); + + +// build string of the form (a[f().x-- + f().x-- + ... + f().x--])-- +// which should give (a[0])-- +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + str = "".concat("(a[", repeat_str("f().x-- + ", (N - 1)), "f().x--])--"); + script = new Script(str); + script(); + + actual = a[0]; + expect = 99; +} +addThis(); + + +status = inSection(3); + +// build string of the form [[1], [1], ..., [1]] +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + str = "".concat("[", repeat_str("[1], ", (N - 1)), "[1]]"); + script = new Script(str); + script(); + + actual = uneval(script()); + expect = str; +} +addThis(); + + +status = inSection(4); + +// build string of the form ({1:{a:1}, 2:{a:1}, ... N:{a:1}}) +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + str = function() { + var arr = new Array(N+1); + arr[0] = "({"; + for (var i = 1; i < N; ++i) { + arr[i] = i+":{a:1}, "; + } + arr[N] = N+":{a:1}})"; + return "".concat.apply("", arr); + }(); + + script = new Script(str); + script(); + + actual = uneval(script()); + expect = str; +} +addThis(); + + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + + +function repeat_str(str, repeat_count) +{ + var arr = new Array(--repeat_count); + while (repeat_count != 0) + arr[--repeat_count] = str; + return str.concat.apply(str, arr); +} + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc('test'); + printBugNumber(BUGNUMBER); + printStatus(summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-226078.js b/js/src/tests/js1_5/extensions/regress-226078.js new file mode 100644 index 000000000..178d0a11f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-226078.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 = 226078; +var summary = 'Do not Crash @ js_Interpret 3127f864'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +function SetLangHead(l){ + with(p){ + for(var i in x) + if(getElementById("TxtH"+i)!=undefined) + printStatus('huh'); + } +} +x=[0,1,2,3]; +p={getElementById: function (id){printStatus(uneval(this), id); return undefined;}}; +SetLangHead(1); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-226507.js b/js/src/tests/js1_5/extensions/regress-226507.js new file mode 100644 index 000000000..8d4fc0dd7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-226507.js @@ -0,0 +1,153 @@ +/* -*- 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/. */ + +/* + * + * Date: 24 Nov 2003 + * SUMMARY: Testing for recursion check in js_EmitTree + * + * See http://bugzilla.mozilla.org/show_bug.cgi?id=226507 + * Igor's comments: + * + * "For example, with N in the test set to 35, I got on my RedHat + * Linux 10 box a segmentation fault from js after setting the stack limit + * to 100K. When I set the stack limit to 20K I still got the segmentation fault. + * Only after -s was changed to 15K, too-deep recursion was detected: + * + + ~/w/js/x> ulimit -s + 100 + ~/w/js/x> js fintest.js + Segmentation fault + ~/w/js/x> js -S $((20*1024)) fintest.js + Segmentation fault + ~/w/js/x> js -S $((15*1024)) fintest.js + fintest.js:19: InternalError: too much recursion + + * + * After playing with numbers it seems that while processing try/finally the + * recursion in js_Emit takes 10 times more space the corresponding recursion + * in the parser." + * + * + * Note the use of the new -S option to the JS shell to limit stack size. + * See http://bugzilla.mozilla.org/show_bug.cgi?id=225061. This in turn + * can be passed to the JS shell by the test driver's -o option, as in: + * + * perl jsDriver.pl -e smdebug -fTEST.html -o "-S 100" -l js1_5/Regress + * + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 226507; +var summary = 'Testing for recursion check in js_EmitTree'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; + + +/* + * With stack limit 100K on Linux debug build even N=30 already can cause + * stack overflow; use 35 to trigger it for sure. + */ +var N = 350; + +var counter = 0; +function f() +{ + ++counter; +} + + +/* + * Example: if N were 3, this is what |source| + * would end up looking like: + * + * try { f(); } finally { + * try { f(); } finally { + * try { f(); } finally { + * f(1,1,1,1); + * }}} + * + */ +var source = "".concat( + repeat_str("try { f(); } finally {\n", N), + "f(", + repeat_str("1,", N), + "1);\n", + repeat_str("}", N)); + +// Repeat it for additional stress testing +source += source; + +/* + * In Rhino, eval() always uses interpreted mode. + * To use compiled mode, use Script.exec() instead. + */ +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); + expect = actual = 0; +} +else +{ + try + { + var script = Script(source); + script(); + + + status = inSection(1); + actual = counter; + expect = (N + 1) * 2; + } + catch(ex) + { + actual = ex + ''; + } +} +addThis(); + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + + +function repeat_str(str, repeat_count) +{ + var arr = new Array(--repeat_count); + while (repeat_count != 0) + arr[--repeat_count] = str; + return str.concat.apply(str, arr); +} + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc('test'); + printBugNumber(BUGNUMBER); + printStatus(summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-231518.js b/js/src/tests/js1_5/extensions/regress-231518.js new file mode 100644 index 000000000..12419da36 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-231518.js @@ -0,0 +1,101 @@ +/* -*- 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 = 231518; +var summary = 'decompiler must quote keywords and non-identifier property names'; +var actual = ''; +var expect = 'no error'; +var status; +var object; +var result; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +if (typeof uneval != 'undefined') +{ + status = inSection(1) + ' eval(uneval({"if": false}))'; + + try + { + object = {'if': false }; + result = uneval(object); + printStatus('uneval returns ' + result); + eval(result); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + } + + reportCompare(expect, actual, status); + + status = inSection(2) + ' eval(uneval({"if": "then"}))'; + + try + { + object = {'if': "then" }; + result = uneval(object); + printStatus('uneval returns ' + result); + eval(result); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + } + + reportCompare(expect, actual, status); + + status = inSection(3) + ' eval(uneval(f))'; + + try + { + result = uneval(f); + printStatus('uneval returns ' + result); + eval(result); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + } + + reportCompare(expect, actual, status); + + status = inSection(2) + ' eval(uneval(g))'; + + try + { + result = uneval(g); + printStatus('uneval returns ' + result); + eval(result); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + } + + reportCompare(expect, actual, status); +} + +function f() +{ + var obj = new Object(); + + obj['name'] = 'Just a name'; + obj['if'] = false; + obj['some text'] = 'correct'; +} + +function g() +{ + return {'if': "then"}; +} + diff --git a/js/src/tests/js1_5/extensions/regress-237461.js b/js/src/tests/js1_5/extensions/regress-237461.js new file mode 100644 index 000000000..c079d5f1f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-237461.js @@ -0,0 +1,46 @@ +/* -*- 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 = 237461; +var summary = 'don\'t crash with nested function collides with var'; +var actual = 'Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function g() +{ + var core = {}; + core.js = {}; + core.js.init = function() + { + var loader = null; + + function loader() {} + }; + return core; +} + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + var s = new Script(""+g.toString()); + try + { + var frozen = s.freeze(); // crash. + printStatus("len:" + frozen.length); + } + catch(e) + { + } +} +actual = 'No Crash'; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-245148.js b/js/src/tests/js1_5/extensions/regress-245148.js new file mode 100644 index 000000000..0b4ca051b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-245148.js @@ -0,0 +1,21 @@ +/* -*- 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 = 245148; +var summary = '[null].toSource() == "[null]"'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof Array.prototype.toSource != 'undefined') +{ + expect = '[null]'; + actual = [null].toSource(); + + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_5/extensions/regress-245795.js b/js/src/tests/js1_5/extensions/regress-245795.js new file mode 100644 index 000000000..a823fc2f6 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-245795.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 = 245795; +var summary = 'eval(uneval(function)) should be round-trippable'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function a() +{ + b = function() {}; +} + +var r = "function a() { b = function() {}; }"; +eval(uneval(a)); + +var v = a.toString().replace(/[ \n]+/g, ' '); +print(v) + +printStatus("[" + v + "]"); + +expect = r; +actual = v; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-254375.js b/js/src/tests/js1_5/extensions/regress-254375.js new file mode 100644 index 000000000..26972900d --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-254375.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 = 254375; +var summary = 'Object.toSource for negative number property names'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof uneval != 'undefined') +{ + try + { + expect = 'no error'; + eval(uneval({'-1':true})); + actual = 'no error'; + } + catch(e) + { + actual = 'error'; + } + + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_5/extensions/regress-255245.js b/js/src/tests/js1_5/extensions/regress-255245.js new file mode 100644 index 000000000..0138fe435 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-255245.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 = 255245; +var summary = 'Function.prototype.toSource/.toString show "setrval" instead of "return"'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function f() { + try { + } catch (e) { + return false; + } + finally { + } +} + +if (typeof f.toSource != 'undefined') +{ + expect = -1; + actual = f.toSource().indexOf('setrval'); + + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_5/extensions/regress-291213.js b/js/src/tests/js1_5/extensions/regress-291213.js new file mode 100644 index 000000000..d3c61a042 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-291213.js @@ -0,0 +1,48 @@ +/* -*- 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 = 291213; +var summary = 'Do not crash in args_resolve enumerating |arguments|'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +var scriptCode = "var result = \"\" + arguments; " + + "for (i in arguments) " + + "result += \"\\\n \" + i + \" \" + arguments[i]; result;"; +var scripts = {}; + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + scripts["A"] = new Script(scriptCode); + + scripts["B"] = (function() { + return new Script(scriptCode); + })(); + + scripts["C"] = (function() { + function x() { "a"; } + return new Script(scriptCode); + })(); + +// any Object (window, document, new Array(), ...) + var anyObj = new Object(); + scripts["D"] = (function() { + function x() { anyObj; } + return new Script(scriptCode); + })(); + + var result; + for (var i in scripts) { + try { result = scripts[i].exec(); } + catch (e) { result = e; } + printStatus(i + ") " + result); + } +} +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-300079.js b/js/src/tests/js1_5/extensions/regress-300079.js new file mode 100644 index 000000000..7d671b602 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-300079.js @@ -0,0 +1,47 @@ +/* -*- 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 = 300079; +var summary = "precompiled functions should inherit from current window's Function.prototype"; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof clone == 'undefined') { + expect = 'SKIPPED'; + actual = 'SKIPPED'; + } + else { + expect = 'PASSED'; + + f = evaluate("(function () { return a * a; })"); + g = clone(f, {a: 3}); + f = null; + gc(); + try { + a_squared = g(2); + if (a_squared != 9) + throw "Unexpected return from g: a_squared == " + a_squared; + actual = "PASSED"; + } catch (e) { + actual = "FAILED: " + e; + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-303277.js b/js/src/tests/js1_5/extensions/regress-303277.js new file mode 100644 index 000000000..319d9a2ed --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-303277.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 = 303277; +var summary = 'Do not crash with crash with a watchpoint for __proto__ property '; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var o = {}; +o.watch("__proto__", function(){return null;}); +o.__proto__ = null; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-304897.js b/js/src/tests/js1_5/extensions/regress-304897.js new file mode 100644 index 000000000..940cba79c --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-304897.js @@ -0,0 +1,20 @@ +/* -*- 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 = 304897; +var summary = 'uneval("\\t"), uneval("\\x09")'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expect = '"\\t"'; +actual = uneval('\t'); +reportCompare(expect, actual, summary); + +actual = uneval('\x09'); +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-306738.js b/js/src/tests/js1_5/extensions/regress-306738.js new file mode 100644 index 000000000..0493e0714 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-306738.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 = 306738; +var summary = 'uneval() on objects with getter or setter'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +actual = uneval( + { + get foo() + { + return "foo"; + } + }); + +expect = '({get foo() {return "foo";}})'; + +compareSource(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-311161.js b/js/src/tests/js1_5/extensions/regress-311161.js new file mode 100644 index 000000000..049d8eb2e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-311161.js @@ -0,0 +1,1438 @@ +/* -*- 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 = 311161; +var summary = 'toSource exposes random memory or crashes'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +var commands = + [{origCount:1, fun:(function anonymous() {allElements[2].style.background = "#fcd";})}, +{origCount:2, fun:(function anonymous() {allElements[9].style.width = "20em";})}, +{origCount:3, fun:(function anonymous() {allElements[4].style.width = "200%";})}, +{origCount:4, fun:(function anonymous() {allElements[6].style.clear = "right";})}, +{origCount:5, fun:(function anonymous() {allElements[8].style.visibility = "hidden";})}, +{origCount:6, fun:(function anonymous() {allElements[1].style.overflow = "visible";})}, +{origCount:7, fun:(function anonymous() {allElements[4].style.position = "fixed";})}, +{origCount:8, fun:(function anonymous() {allElements[10].style.display = "-moz-inline-stack";})}, +{origCount:9, fun:(function anonymous() {allElements[10].style.overflow = "auto";})}, +{origCount:10, fun:(function anonymous() {allElements[11].style.color = "red";})}, +{origCount:11, fun:(function anonymous() {allElements[4].style.height = "2em";})}, +{origCount:12, fun:(function anonymous() {allElements[9].style.height = "100px";})}, +{origCount:13, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:14, fun:(function anonymous() {allElements[9].style.color = "blue";})}, +{origCount:15, fun:(function anonymous() {allElements[2].style.clear = "right";})}, +{origCount:16, fun:(function anonymous() {allElements[1].style.height = "auto";})}, +{origCount:17, fun:(function anonymous() {allElements[0].style.overflow = "hidden";})}, +{origCount:18, fun:(function anonymous() {allElements[4].style.display = "table-row-group";})}, +{origCount:19, fun:(function anonymous() {allElements[4].style.overflow = "auto";})}, +{origCount:20, fun:(function anonymous() {allElements[7].style.height = "100px";})}, +{origCount:21, fun:(function anonymous() {allElements[5].style.color = "green";})}, +{origCount:22, fun:(function anonymous() {allElements[3].style.display = "-moz-grid-group";})}, +{origCount:23, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:24, fun:(function anonymous() {allElements[10].style.position = "static";})}, +{origCount:25, fun:(function anonymous() {allElements[3].style['float'] = "none";})}, +{origCount:26, fun:(function anonymous() {allElements[4].style['float'] = "none";})}, +{origCount:27, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:28, fun:(function anonymous() {allElements[5].style.visibility = "collapse";})}, +{origCount:29, fun:(function anonymous() {allElements[1].style.position = "static";})}, +{origCount:30, fun:(function anonymous() {allElements[2].style.color = "black";})}, +{origCount:31, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:32, fun:(function anonymous() {allElements[0].style.display = "table-row-group";})}, +{origCount:33, fun:(function anonymous() {allElements[9].style.position = "relative";})}, +{origCount:34, fun:(function anonymous() {allElements[5].style.position = "static";})}, +{origCount:35, fun:(function anonymous() {allElements[6].style.background = "transparent";})}, +{origCount:36, fun:(function anonymous() {allElements[6].style.color = "blue";})}, +{origCount:37, fun:(function anonymous() {allElements[9].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:38, fun:(function anonymous() {allElements[8].style.display = "-moz-grid";})}, +{origCount:39, fun:(function anonymous() {allElements[9].style.color = "black";})}, +{origCount:40, fun:(function anonymous() {allElements[4].style.position = "static";})}, +{origCount:41, fun:(function anonymous() {allElements[10].style.height = "auto";})}, +{origCount:42, fun:(function anonymous() {allElements[9].style.color = "green";})}, +{origCount:43, fun:(function anonymous() {allElements[4].style.height = "auto";})}, +{origCount:44, fun:(function anonymous() {allElements[2].style.clear = "both";})}, +{origCount:45, fun:(function anonymous() {allElements[8].style.width = "1px";})}, +{origCount:46, fun:(function anonymous() {allElements[2].style.visibility = "visible";})}, +{origCount:47, fun:(function anonymous() {allElements[1].style.clear = "left";})}, +{origCount:48, fun:(function anonymous() {allElements[11].style.overflow = "auto";})}, +{origCount:49, fun:(function anonymous() {allElements[11].style['float'] = "left";})}, +{origCount:50, fun:(function anonymous() {allElements[8].style['float'] = "left";})}, +{origCount:51, fun:(function anonymous() {allElements[6].style.height = "10%";})}, +{origCount:52, fun:(function anonymous() {allElements[11].style.display = "-moz-inline-stack";})}, +{origCount:53, fun:(function anonymous() {allElements[3].style.clear = "left";})}, +{origCount:54, fun:(function anonymous() {allElements[11].style.visibility = "hidden";})}, +{origCount:55, fun:(function anonymous() {allElements[4].style['float'] = "right";})}, +{origCount:56, fun:(function anonymous() {allElements[0].style.width = "1px";})}, +{origCount:57, fun:(function anonymous() {allElements[3].style.height = "200%";})}, +{origCount:58, fun:(function anonymous() {allElements[7].style.height = "10%";})}, +{origCount:59, fun:(function anonymous() {allElements[4].style.clear = "none";})}, +{origCount:60, fun:(function anonymous() {allElements[11].style['float'] = "none";})}, +{origCount:61, fun:(function anonymous() {allElements[9].style['float'] = "left";})}, +{origCount:62, fun:(function anonymous() {allElements[4].style.overflow = "scroll";})}, +{origCount:63, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:64, fun:(function anonymous() {allElements[2].style.color = "green";})}, +{origCount:65, fun:(function anonymous() {allElements[3].style['float'] = "none";})}, +{origCount:66, fun:(function anonymous() {allElements[10].style.background = "transparent";})}, +{origCount:67, fun:(function anonymous() {allElements[0].style.height = "auto";})}, +{origCount:68, fun:(function anonymous() {allElements[6].style.clear = "left";})}, +{origCount:69, fun:(function anonymous() {allElements[7].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:70, fun:(function anonymous() {allElements[8].style.display = "-moz-popup";})}, +{origCount:71, fun:(function anonymous() {allElements[2].style.height = "10%";})}, +{origCount:72, fun:(function anonymous() {allElements[7].style.display = "table-cell";})}, +{origCount:73, fun:(function anonymous() {allElements[3].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:74, fun:(function anonymous() {allElements[8].style.color = "red";})}, +{origCount:75, fun:(function anonymous() {allElements[1].style.overflow = "auto";})}, +{origCount:76, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:77, fun:(function anonymous() {allElements[0].style.color = "red";})}, +{origCount:78, fun:(function anonymous() {allElements[4].style.background = "#fcd";})}, +{origCount:79, fun:(function anonymous() {allElements[5].style.position = "static";})}, +{origCount:80, fun:(function anonymous() {allElements[8].style.clear = "both";})}, +{origCount:81, fun:(function anonymous() {allElements[7].style.clear = "both";})}, +{origCount:82, fun:(function anonymous() {allElements[5].style.clear = "both";})}, +{origCount:83, fun:(function anonymous() {allElements[10].style.display = "-moz-grid-group";})}, +{origCount:84, fun:(function anonymous() {allElements[12].style.clear = "right";})}, +{origCount:85, fun:(function anonymous() {allElements[5].style['float'] = "left";})}, +{origCount:86, fun:(function anonymous() {allElements[8].style.position = "absolute";})}, +{origCount:87, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:88, fun:(function anonymous() {allElements[9].style.position = "relative";})}, +{origCount:89, fun:(function anonymous() {allElements[5].style.width = "20em";})}, +{origCount:90, fun:(function anonymous() {allElements[6].style.position = "absolute";})}, +{origCount:91, fun:(function anonymous() {allElements[5].style.overflow = "scroll";})}, +{origCount:92, fun:(function anonymous() {allElements[6].style.background = "#fcd";})}, +{origCount:93, fun:(function anonymous() {allElements[2].style.visibility = "visible";})}, +{origCount:94, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:95, fun:(function anonymous() {allElements[0].style.visibility = "hidden";})}, +{origCount:96, fun:(function anonymous() {allElements[0].style.color = "blue";})}, +{origCount:97, fun:(function anonymous() {allElements[3].style['float'] = "left";})}, +{origCount:98, fun:(function anonymous() {allElements[3].style.height = "200%";})}, +{origCount:99, fun:(function anonymous() {allElements[4].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:100, fun:(function anonymous() {allElements[12].style.width = "10%";})}, +{origCount:101, fun:(function anonymous() {allElements[6].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:102, fun:(function anonymous() {allElements[5].style.width = "auto";})}, +{origCount:103, fun:(function anonymous() {allElements[1].style.position = "static";})}, +{origCount:104, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:105, fun:(function anonymous() {allElements[5].style['float'] = "right";})}, +{origCount:106, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:107, fun:(function anonymous() {allElements[11].style['float'] = "none";})}, +{origCount:108, fun:(function anonymous() {allElements[9].style.width = "20em";})}, +{origCount:109, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:110, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:111, fun:(function anonymous() {allElements[6].style.visibility = "collapse";})}, +{origCount:112, fun:(function anonymous() {allElements[11].style.height = "200%";})}, +{origCount:113, fun:(function anonymous() {allElements[3].style.visibility = "visible";})}, +{origCount:114, fun:(function anonymous() {allElements[12].style.width = "200%";})}, +{origCount:115, fun:(function anonymous() {allElements[5].style.height = "10%";})}, +{origCount:116, fun:(function anonymous() {allElements[1].style['float'] = "left";})}, +{origCount:117, fun:(function anonymous() {allElements[5].style.overflow = "scroll";})}, +{origCount:118, fun:(function anonymous() {allElements[9].style.width = "10%";})}, +{origCount:119, fun:(function anonymous() {allElements[6].style.position = "static";})}, +{origCount:120, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:121, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:122, fun:(function anonymous() {allElements[7].style.width = "1px";})}, +{origCount:123, fun:(function anonymous() {allElements[3].style.color = "blue";})}, +{origCount:124, fun:(function anonymous() {allElements[6].style.background = "#fcd";})}, +{origCount:125, fun:(function anonymous() {allElements[8].style.overflow = "auto";})}, +{origCount:126, fun:(function anonymous() {allElements[1].style.overflow = "auto";})}, +{origCount:127, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:128, fun:(function anonymous() {allElements[12].style.color = "green";})}, +{origCount:129, fun:(function anonymous() {allElements[0].style.color = "black";})}, +{origCount:130, fun:(function anonymous() {allElements[1].style.position = "relative";})}, +{origCount:131, fun:(function anonymous() {allElements[9].style.overflow = "auto";})}, +{origCount:132, fun:(function anonymous() {allElements[1].style.display = "table-row";})}, +{origCount:133, fun:(function anonymous() {allElements[10].style['float'] = "right";})}, +{origCount:134, fun:(function anonymous() {allElements[2].style.visibility = "hidden";})}, +{origCount:135, fun:(function anonymous() {allElements[9].style.overflow = "auto";})}, +{origCount:136, fun:(function anonymous() {allElements[9].style.clear = "none";})}, +{origCount:137, fun:(function anonymous() {allElements[9].style.position = "absolute";})}, +{origCount:138, fun:(function anonymous() {allElements[0].style.width = "10%";})}, +{origCount:139, fun:(function anonymous() {allElements[1].style.height = "10%";})}, +{origCount:140, fun:(function anonymous() {allElements[5].style.height = "auto";})}, +{origCount:141, fun:(function anonymous() {allElements[4].style.position = "fixed";})}, +{origCount:142, fun:(function anonymous() {allElements[3].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:143, fun:(function anonymous() {allElements[7].style.display = "table-header-group";})}, +{origCount:144, fun:(function anonymous() {allElements[10].style.position = "fixed";})}, +{origCount:145, fun:(function anonymous() {allElements[4].style.background = "transparent";})}, +{origCount:146, fun:(function anonymous() {allElements[6].style.position = "relative";})}, +{origCount:147, fun:(function anonymous() {allElements[10].style.clear = "both";})}, +{origCount:148, fun:(function anonymous() {allElements[8].style.display = "table-header-group";})}, +{origCount:149, fun:(function anonymous() {allElements[5].style.height = "200%";})}, +{origCount:150, fun:(function anonymous() {allElements[7].style.height = "2em";})}, +{origCount:151, fun:(function anonymous() {allElements[6].style.position = "relative";})}, +{origCount:152, fun:(function anonymous() {allElements[7].style.height = "2em";})}, +{origCount:153, fun:(function anonymous() {allElements[3].style.width = "10%";})}, +{origCount:154, fun:(function anonymous() {allElements[12].style.color = "blue";})}, +{origCount:155, fun:(function anonymous() {allElements[2].style.color = "green";})}, +{origCount:156, fun:(function anonymous() {allElements[2].style.visibility = "visible";})}, +{origCount:157, fun:(function anonymous() {allElements[6].style['float'] = "right";})}, +{origCount:158, fun:(function anonymous() {allElements[6].style.visibility = "collapse";})}, +{origCount:159, fun:(function anonymous() {allElements[8].style.position = "absolute";})}, +{origCount:160, fun:(function anonymous() {allElements[3].style.height = "2em";})}, +{origCount:161, fun:(function anonymous() {allElements[10].style.display = "-moz-grid-line";})}, +{origCount:162, fun:(function anonymous() {allElements[9].style.color = "red";})}, +{origCount:163, fun:(function anonymous() {allElements[6].style.overflow = "hidden";})}, +{origCount:164, fun:(function anonymous() {allElements[4].style.overflow = "scroll";})}, +{origCount:165, fun:(function anonymous() {allElements[11].style.height = "100px";})}, +{origCount:166, fun:(function anonymous() {allElements[5].style.display = "table-footer-group";})}, +{origCount:167, fun:(function anonymous() {allElements[5].style.color = "red";})}, +{origCount:168, fun:(function anonymous() {allElements[3].style.width = "20em";})}, +{origCount:169, fun:(function anonymous() {allElements[4].style['float'] = "right";})}, +{origCount:170, fun:(function anonymous() {allElements[2].style.background = "transparent";})}, +{origCount:171, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:172, fun:(function anonymous() {allElements[6].style.visibility = "hidden";})}, +{origCount:173, fun:(function anonymous() {allElements[11].style['float'] = "right";})}, +{origCount:174, fun:(function anonymous() {allElements[8].style.height = "200%";})}, +{origCount:175, fun:(function anonymous() {allElements[1].style.position = "relative";})}, +{origCount:176, fun:(function anonymous() {allElements[11].style.width = "auto";})}, +{origCount:177, fun:(function anonymous() {allElements[2].style.background = "#fcd";})}, +{origCount:178, fun:(function anonymous() {allElements[6].style.position = "absolute";})}, +{origCount:179, fun:(function anonymous() {allElements[3].style.position = "absolute";})}, +{origCount:180, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:181, fun:(function anonymous() {allElements[11].style.background = "transparent";})}, +{origCount:182, fun:(function anonymous() {allElements[6].style.height = "200%";})}, +{origCount:183, fun:(function anonymous() {allElements[2].style['float'] = "none";})}, +{origCount:184, fun:(function anonymous() {allElements[5].style.position = "absolute";})}, +{origCount:185, fun:(function anonymous() {allElements[8].style.color = "blue";})}, +{origCount:186, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:187, fun:(function anonymous() {allElements[6].style.height = "200%";})}, +{origCount:188, fun:(function anonymous() {allElements[0].style.width = "20em";})}, +{origCount:189, fun:(function anonymous() {allElements[1].style.display = "table-row-group";})}, +{origCount:190, fun:(function anonymous() {allElements[3].style.visibility = "hidden";})}, +{origCount:191, fun:(function anonymous() {allElements[11].style.width = "10%";})}, +{origCount:192, fun:(function anonymous() {allElements[4].style.width = "200%";})}, +{origCount:193, fun:(function anonymous() {allElements[0].style['float'] = "right";})}, +{origCount:194, fun:(function anonymous() {allElements[5].style.background = "#fcd";})}, +{origCount:195, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:196, fun:(function anonymous() {allElements[0].style.display = "table-column";})}, +{origCount:197, fun:(function anonymous() {allElements[0].style.width = "auto";})}, +{origCount:198, fun:(function anonymous() {allElements[4].style.color = "green";})}, +{origCount:199, fun:(function anonymous() {allElements[6].style.clear = "none";})}, +{origCount:200, fun:(function anonymous() {allElements[10].style.overflow = "hidden";})}, +{origCount:201, fun:(function anonymous() {allElements[9].style.visibility = "collapse";})}, +{origCount:202, fun:(function anonymous() {allElements[9].style.height = "100px";})}, +{origCount:203, fun:(function anonymous() {allElements[1].style.width = "auto";})}, +{origCount:204, fun:(function anonymous() {allElements[4].style.position = "fixed";})}, +{origCount:205, fun:(function anonymous() {allElements[11].style['float'] = "none";})}, +{origCount:206, fun:(function anonymous() {allElements[1].style.clear = "right";})}, +{origCount:207, fun:(function anonymous() {allElements[5].style.display = "-moz-stack";})}, +{origCount:208, fun:(function anonymous() {allElements[3].style.color = "black";})}, +{origCount:209, fun:(function anonymous() {allElements[1].style.background = "transparent";})}, +{origCount:210, fun:(function anonymous() {allElements[3].style['float'] = "left";})}, +{origCount:211, fun:(function anonymous() {allElements[2].style.height = "2em";})}, +{origCount:212, fun:(function anonymous() {allElements[4].style.width = "auto";})}, +{origCount:213, fun:(function anonymous() {allElements[0].style['float'] = "none";})}, +{origCount:214, fun:(function anonymous() {allElements[10].style.display = "table-caption";})}, +{origCount:215, fun:(function anonymous() {allElements[0].style.overflow = "auto";})}, +{origCount:216, fun:(function anonymous() {allElements[0].style.color = "green";})}, +{origCount:217, fun:(function anonymous() {allElements[5].style.background = "#fcd";})}, +{origCount:218, fun:(function anonymous() {allElements[5].style.visibility = "hidden";})}, +{origCount:219, fun:(function anonymous() {allElements[7].style.width = "200%";})}, +{origCount:220, fun:(function anonymous() {allElements[2].style.background = "transparent";})}, +{origCount:221, fun:(function anonymous() {allElements[10].style.visibility = "hidden";})}, +{origCount:222, fun:(function anonymous() {allElements[10].style['float'] = "right";})}, +{origCount:223, fun:(function anonymous() {allElements[6].style.position = "absolute";})}, +{origCount:224, fun:(function anonymous() {allElements[5].style.background = "transparent";})}, +{origCount:225, fun:(function anonymous() {allElements[12].style.overflow = "hidden";})}, +{origCount:226, fun:(function anonymous() {allElements[7].style.clear = "left";})}, +{origCount:227, fun:(function anonymous() {allElements[7].style.height = "200%";})}, +{origCount:228, fun:(function anonymous() {allElements[5].style.position = "absolute";})}, +{origCount:229, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:230, fun:(function anonymous() {allElements[5].style.clear = "both";})}, +{origCount:231, fun:(function anonymous() {allElements[4].style.clear = "left";})}, +{origCount:232, fun:(function anonymous() {allElements[10].style.position = "fixed";})}, +{origCount:233, fun:(function anonymous() {allElements[2].style.overflow = "scroll";})}, +{origCount:234, fun:(function anonymous() {allElements[12].style.background = "#fcd";})}, +{origCount:235, fun:(function anonymous() {allElements[6].style.color = "black";})}, +{origCount:236, fun:(function anonymous() {allElements[3].style.position = "absolute";})}, +{origCount:237, fun:(function anonymous() {allElements[8].style.color = "red";})}, +{origCount:238, fun:(function anonymous() {allElements[12].style.background = "transparent";})}, +{origCount:239, fun:(function anonymous() {allElements[10].style['float'] = "none";})}, +{origCount:240, fun:(function anonymous() {allElements[6].style['float'] = "right";})}, +{origCount:241, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:242, fun:(function anonymous() {allElements[0].style.color = "red";})}, +{origCount:243, fun:(function anonymous() {allElements[10].style['float'] = "none";})}, +{origCount:244, fun:(function anonymous() {allElements[1].style.width = "1px";})}, +{origCount:245, fun:(function anonymous() {allElements[3].style.position = "fixed";})}, +{origCount:246, fun:(function anonymous() {allElements[11].style.clear = "left";})}, +{origCount:247, fun:(function anonymous() {allElements[2].style.position = "absolute";})}, +{origCount:248, fun:(function anonymous() {allElements[9].style.background = "#fcd";})}, +{origCount:249, fun:(function anonymous() {allElements[11].style.position = "relative";})}, +{origCount:250, fun:(function anonymous() {allElements[1].style.height = "100px";})}, +{origCount:251, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:252, fun:(function anonymous() {allElements[2].style.display = "block";})}, +{origCount:253, fun:(function anonymous() {allElements[12].style.background = "#fcd";})}, +{origCount:254, fun:(function anonymous() {allElements[4].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:255, fun:(function anonymous() {allElements[12].style.color = "black";})}, +{origCount:256, fun:(function anonymous() {allElements[0].style.height = "auto";})}, +{origCount:257, fun:(function anonymous() {allElements[0].style.height = "100px";})}, +{origCount:258, fun:(function anonymous() {allElements[5].style.clear = "right";})}, +{origCount:259, fun:(function anonymous() {allElements[7].style.height = "100px";})}, +{origCount:260, fun:(function anonymous() {allElements[11].style.background = "transparent";})}, +{origCount:261, fun:(function anonymous() {allElements[11].style.width = "20em";})}, +{origCount:262, fun:(function anonymous() {allElements[10].style.width = "1px";})}, +{origCount:263, fun:(function anonymous() {allElements[3].style.clear = "left";})}, +{origCount:264, fun:(function anonymous() {allElements[7].style['float'] = "left";})}, +{origCount:265, fun:(function anonymous() {allElements[1].style['float'] = "none";})}, +{origCount:266, fun:(function anonymous() {allElements[4].style.overflow = "scroll";})}, +{origCount:267, fun:(function anonymous() {allElements[9].style.height = "auto";})}, +{origCount:268, fun:(function anonymous() {allElements[7].style.background = "transparent";})}, +{origCount:269, fun:(function anonymous() {allElements[5].style.display = "table";})}, +{origCount:270, fun:(function anonymous() {allElements[7].style.width = "200%";})}, +{origCount:271, fun:(function anonymous() {allElements[7].style.clear = "left";})}, +{origCount:272, fun:(function anonymous() {allElements[9].style.visibility = "hidden";})}, +{origCount:273, fun:(function anonymous() {allElements[6].style.height = "10%";})}, +{origCount:274, fun:(function anonymous() {allElements[3].style.position = "fixed";})}, +{origCount:275, fun:(function anonymous() {allElements[6].style.display = "block";})}, +{origCount:276, fun:(function anonymous() {allElements[7].style.overflow = "visible";})}, +{origCount:277, fun:(function anonymous() {allElements[12].style['float'] = "none";})}, +{origCount:278, fun:(function anonymous() {allElements[0].style['float'] = "none";})}, +{origCount:279, fun:(function anonymous() {allElements[2].style.height = "10%";})}, +{origCount:280, fun:(function anonymous() {allElements[11].style.clear = "right";})}, +{origCount:281, fun:(function anonymous() {allElements[6].style.clear = "both";})}, +{origCount:282, fun:(function anonymous() {allElements[6].style.display = "-moz-box";})}, +{origCount:283, fun:(function anonymous() {allElements[3].style.height = "100px";})}, +{origCount:284, fun:(function anonymous() {allElements[2].style.color = "blue";})}, +{origCount:285, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:286, fun:(function anonymous() {allElements[4].style.background = "transparent";})}, +{origCount:287, fun:(function anonymous() {allElements[5].style.height = "auto";})}, +{origCount:288, fun:(function anonymous() {allElements[3].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:289, fun:(function anonymous() {allElements[5].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:290, fun:(function anonymous() {allElements[4].style.clear = "right";})}, +{origCount:291, fun:(function anonymous() {allElements[3].style.overflow = "auto";})}, +{origCount:292, fun:(function anonymous() {allElements[10].style.display = "-moz-stack";})}, +{origCount:293, fun:(function anonymous() {allElements[2].style.color = "red";})}, +{origCount:294, fun:(function anonymous() {allElements[0].style.display = "-moz-groupbox";})}, +{origCount:295, fun:(function anonymous() {allElements[7].style.position = "fixed";})}, +{origCount:296, fun:(function anonymous() {allElements[4].style.color = "green";})}, +{origCount:297, fun:(function anonymous() {allElements[9].style.display = "-moz-box";})}, +{origCount:298, fun:(function anonymous() {allElements[1].style.color = "green";})}, +{origCount:299, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:300, fun:(function anonymous() {allElements[8].style.color = "red";})}, +{origCount:301, fun:(function anonymous() {allElements[8].style['float'] = "left";})}, +{origCount:302, fun:(function anonymous() {allElements[3].style.height = "2em";})}, +{origCount:303, fun:(function anonymous() {allElements[1].style.width = "auto";})}, +{origCount:304, fun:(function anonymous() {allElements[4].style.height = "10%";})}, +{origCount:305, fun:(function anonymous() {allElements[8].style.width = "20em";})}, +{origCount:306, fun:(function anonymous() {allElements[2].style.height = "2em";})}, +{origCount:307, fun:(function anonymous() {allElements[7].style.color = "red";})}, +{origCount:308, fun:(function anonymous() {allElements[2].style.display = "-moz-inline-box";})}, +{origCount:309, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:310, fun:(function anonymous() {allElements[7].style.display = "-moz-deck";})}, +{origCount:311, fun:(function anonymous() {allElements[2].style.visibility = "hidden";})}, +{origCount:312, fun:(function anonymous() {allElements[9].style.clear = "both";})}, +{origCount:313, fun:(function anonymous() {allElements[6].style['float'] = "left";})}, +{origCount:314, fun:(function anonymous() {allElements[12].style.position = "static";})}, +{origCount:315, fun:(function anonymous() {allElements[6].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:316, fun:(function anonymous() {allElements[8].style.visibility = "visible";})}, +{origCount:317, fun:(function anonymous() {allElements[8].style.background = "#fcd";})}, +{origCount:318, fun:(function anonymous() {allElements[1].style.visibility = "collapse";})}, +{origCount:319, fun:(function anonymous() {allElements[3].style.position = "static";})}, +{origCount:320, fun:(function anonymous() {allElements[8].style.overflow = "hidden";})}, +{origCount:321, fun:(function anonymous() {allElements[8].style.clear = "left";})}, +{origCount:322, fun:(function anonymous() {allElements[8].style.position = "static";})}, +{origCount:323, fun:(function anonymous() {allElements[1].style['float'] = "none";})}, +{origCount:324, fun:(function anonymous() {allElements[5].style.visibility = "hidden";})}, +{origCount:325, fun:(function anonymous() {allElements[12].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:326, fun:(function anonymous() {allElements[3].style.overflow = "visible";})}, +{origCount:327, fun:(function anonymous() {allElements[8].style.visibility = "collapse";})}, +{origCount:328, fun:(function anonymous() {allElements[7].style.position = "static";})}, +{origCount:329, fun:(function anonymous() {allElements[5].style.visibility = "collapse";})}, +{origCount:330, fun:(function anonymous() {allElements[8].style.visibility = "visible";})}, +{origCount:331, fun:(function anonymous() {allElements[8].style.height = "auto";})}, +{origCount:332, fun:(function anonymous() {allElements[10].style.overflow = "scroll";})}, +{origCount:333, fun:(function anonymous() {allElements[7].style.overflow = "visible";})}, +{origCount:334, fun:(function anonymous() {allElements[5].style.visibility = "visible";})}, +{origCount:335, fun:(function anonymous() {allElements[8].style.position = "fixed";})}, +{origCount:336, fun:(function anonymous() {allElements[10].style.display = "-moz-grid-line";})}, +{origCount:337, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:338, fun:(function anonymous() {allElements[3].style.position = "absolute";})}, +{origCount:339, fun:(function anonymous() {allElements[5].style.color = "green";})}, +{origCount:340, fun:(function anonymous() {allElements[2].style.display = "-moz-groupbox";})}, +{origCount:341, fun:(function anonymous() {allElements[10].style.overflow = "auto";})}, +{origCount:342, fun:(function anonymous() {allElements[10].style['float'] = "left";})}, +{origCount:343, fun:(function anonymous() {allElements[8].style.clear = "both";})}, +{origCount:344, fun:(function anonymous() {allElements[8].style.clear = "right";})}, +{origCount:345, fun:(function anonymous() {allElements[2].style.color = "blue";})}, +{origCount:346, fun:(function anonymous() {allElements[10].style.height = "10%";})}, +{origCount:347, fun:(function anonymous() {allElements[11].style.overflow = "hidden";})}, +{origCount:348, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:349, fun:(function anonymous() {allElements[0].style['float'] = "left";})}, +{origCount:350, fun:(function anonymous() {allElements[11].style.width = "10%";})}, +{origCount:351, fun:(function anonymous() {allElements[11].style.overflow = "hidden";})}, +{origCount:352, fun:(function anonymous() {allElements[5].style.color = "green";})}, +{origCount:353, fun:(function anonymous() {allElements[11].style.position = "relative";})}, +{origCount:354, fun:(function anonymous() {allElements[9].style.position = "static";})}, +{origCount:355, fun:(function anonymous() {allElements[4].style.height = "10%";})}, +{origCount:356, fun:(function anonymous() {allElements[1].style.position = "fixed";})}, +{origCount:357, fun:(function anonymous() {allElements[6].style.position = "fixed";})}, +{origCount:358, fun:(function anonymous() {allElements[12].style.display = "block";})}, +{origCount:359, fun:(function anonymous() {allElements[10].style.display = "-moz-inline-block";})}, +{origCount:360, fun:(function anonymous() {allElements[6].style.height = "100px";})}, +{origCount:361, fun:(function anonymous() {allElements[6].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:362, fun:(function anonymous() {allElements[2].style['float'] = "right";})}, +{origCount:363, fun:(function anonymous() {allElements[0].style.display = "-moz-grid-group";})}, +{origCount:364, fun:(function anonymous() {allElements[4].style.background = "#fcd";})}, +{origCount:365, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:366, fun:(function anonymous() {allElements[3].style.position = "relative";})}, +{origCount:367, fun:(function anonymous() {allElements[8].style.position = "static";})}, +{origCount:368, fun:(function anonymous() {allElements[3].style.position = "relative";})}, +{origCount:369, fun:(function anonymous() {allElements[5].style.width = "auto";})}, +{origCount:370, fun:(function anonymous() {allElements[8].style.clear = "none";})}, +{origCount:371, fun:(function anonymous() {allElements[4].style.color = "red";})}, +{origCount:372, fun:(function anonymous() {allElements[11].style.width = "auto";})}, +{origCount:373, fun:(function anonymous() {allElements[9].style['float'] = "right";})}, +{origCount:374, fun:(function anonymous() {allElements[2].style.width = "20em";})}, +{origCount:375, fun:(function anonymous() {allElements[10].style.position = "relative";})}, +{origCount:376, fun:(function anonymous() {allElements[12].style.position = "relative";})}, +{origCount:377, fun:(function anonymous() {allElements[0].style.display = "-moz-grid";})}, +{origCount:378, fun:(function anonymous() {allElements[5].style.clear = "left";})}, +{origCount:379, fun:(function anonymous() {allElements[8].style.color = "green";})}, +{origCount:380, fun:(function anonymous() {allElements[0].style.clear = "both";})}, +{origCount:381, fun:(function anonymous() {allElements[0].style['float'] = "left";})}, +{origCount:382, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:383, fun:(function anonymous() {allElements[7].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:384, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:385, fun:(function anonymous() {allElements[7].style['float'] = "right";})}, +{origCount:386, fun:(function anonymous() {allElements[11].style.display = "table-row";})}, +{origCount:387, fun:(function anonymous() {allElements[3].style.position = "absolute";})}, +{origCount:388, fun:(function anonymous() {allElements[2].style.height = "200%";})}, +{origCount:389, fun:(function anonymous() {allElements[1].style.clear = "none";})}, +{origCount:390, fun:(function anonymous() {allElements[4].style.position = "static";})}, +{origCount:391, fun:(function anonymous() {allElements[4].style.position = "relative";})}, +{origCount:392, fun:(function anonymous() {allElements[7].style.position = "fixed";})}, +{origCount:393, fun:(function anonymous() {allElements[4].style.background = "transparent";})}, +{origCount:394, fun:(function anonymous() {allElements[2].style.height = "200%";})}, +{origCount:395, fun:(function anonymous() {allElements[6].style.position = "relative";})}, +{origCount:396, fun:(function anonymous() {allElements[8].style.overflow = "auto";})}, +{origCount:397, fun:(function anonymous() {allElements[0].style.background = "transparent";})}, +{origCount:398, fun:(function anonymous() {allElements[2].style.position = "static";})}, +{origCount:399, fun:(function anonymous() {allElements[4].style['float'] = "none";})}, +{origCount:400, fun:(function anonymous() {allElements[1].style.height = "200%";})}, +{origCount:401, fun:(function anonymous() {allElements[10].style.color = "green";})}, +{origCount:402, fun:(function anonymous() {allElements[11].style.overflow = "hidden";})}, +{origCount:403, fun:(function anonymous() {allElements[8].style.height = "200%";})}, +{origCount:404, fun:(function anonymous() {allElements[9].style.visibility = "hidden";})}, +{origCount:405, fun:(function anonymous() {allElements[4].style.display = "block";})}, +{origCount:406, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:407, fun:(function anonymous() {allElements[0].style.width = "auto";})}, +{origCount:408, fun:(function anonymous() {allElements[0].style.position = "static";})}, +{origCount:409, fun:(function anonymous() {allElements[2].style['float'] = "right";})}, +{origCount:410, fun:(function anonymous() {allElements[1].style.display = "-moz-grid-group";})}, +{origCount:411, fun:(function anonymous() {allElements[2].style.visibility = "hidden";})}, +{origCount:412, fun:(function anonymous() {allElements[9].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:413, fun:(function anonymous() {allElements[2].style.width = "auto";})}, +{origCount:414, fun:(function anonymous() {allElements[0].style.display = "-moz-inline-box";})}, +{origCount:415, fun:(function anonymous() {allElements[9].style.clear = "none";})}, +{origCount:416, fun:(function anonymous() {allElements[6].style['float'] = "none";})}, +{origCount:417, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:418, fun:(function anonymous() {allElements[5].style.position = "absolute";})}, +{origCount:419, fun:(function anonymous() {allElements[3].style.width = "1px";})}, +{origCount:420, fun:(function anonymous() {allElements[0].style.height = "2em";})}, +{origCount:421, fun:(function anonymous() {allElements[0].style['float'] = "right";})}, +{origCount:422, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:423, fun:(function anonymous() {allElements[8].style.display = "-moz-inline-box";})}, +{origCount:424, fun:(function anonymous() {allElements[12].style.clear = "none";})}, +{origCount:425, fun:(function anonymous() {allElements[3].style.background = "transparent";})}, +{origCount:426, fun:(function anonymous() {allElements[12].style.overflow = "scroll";})}, +{origCount:427, fun:(function anonymous() {allElements[4].style.height = "200%";})}, +{origCount:428, fun:(function anonymous() {allElements[12].style.visibility = "collapse";})}, +{origCount:429, fun:(function anonymous() {allElements[2].style.clear = "right";})}, +{origCount:430, fun:(function anonymous() {allElements[6].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:431, fun:(function anonymous() {allElements[2].style.color = "blue";})}, +{origCount:432, fun:(function anonymous() {allElements[9].style.clear = "right";})}, +{origCount:433, fun:(function anonymous() {allElements[7].style.background = "transparent";})}, +{origCount:434, fun:(function anonymous() {allElements[1].style.width = "10%";})}, +{origCount:435, fun:(function anonymous() {allElements[9].style.width = "10%";})}, +{origCount:436, fun:(function anonymous() {allElements[11].style.display = "table-column-group";})}, +{origCount:437, fun:(function anonymous() {allElements[0].style.visibility = "visible";})}, +{origCount:438, fun:(function anonymous() {allElements[6].style.color = "black";})}, +{origCount:439, fun:(function anonymous() {allElements[9].style.position = "relative";})}, +{origCount:440, fun:(function anonymous() {allElements[1].style.visibility = "hidden";})}, +{origCount:441, fun:(function anonymous() {allElements[2].style.overflow = "hidden";})}, +{origCount:442, fun:(function anonymous() {allElements[3].style.color = "black";})}, +{origCount:443, fun:(function anonymous() {allElements[9].style.height = "200%";})}, +{origCount:444, fun:(function anonymous() {allElements[1].style.height = "200%";})}, +{origCount:445, fun:(function anonymous() {allElements[9].style['float'] = "right";})}, +{origCount:446, fun:(function anonymous() {allElements[1].style.color = "green";})}, +{origCount:447, fun:(function anonymous() {allElements[6].style.clear = "left";})}, +{origCount:448, fun:(function anonymous() {allElements[6].style.height = "2em";})}, +{origCount:449, fun:(function anonymous() {allElements[5].style.overflow = "visible";})}, +{origCount:450, fun:(function anonymous() {allElements[8].style.visibility = "collapse";})}, +{origCount:451, fun:(function anonymous() {allElements[9].style.color = "blue";})}, +{origCount:452, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:453, fun:(function anonymous() {allElements[10].style.color = "red";})}, +{origCount:454, fun:(function anonymous() {allElements[8].style.display = "table-cell";})}, +{origCount:455, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:456, fun:(function anonymous() {allElements[2].style.overflow = "auto";})}, +{origCount:457, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:458, fun:(function anonymous() {allElements[9].style.clear = "left";})}, +{origCount:459, fun:(function anonymous() {allElements[12].style.clear = "right";})}, +{origCount:460, fun:(function anonymous() {allElements[9].style.position = "absolute";})}, +{origCount:461, fun:(function anonymous() {allElements[6].style.position = "fixed";})}, +{origCount:462, fun:(function anonymous() {allElements[7].style.color = "blue";})}, +{origCount:463, fun:(function anonymous() {allElements[5].style.position = "absolute";})}, +{origCount:464, fun:(function anonymous() {allElements[5].style.display = "-moz-popup";})}, +{origCount:465, fun:(function anonymous() {allElements[1].style.position = "static";})}, +{origCount:466, fun:(function anonymous() {allElements[9].style.position = "absolute";})}, +{origCount:467, fun:(function anonymous() {allElements[11].style.background = "transparent";})}, +{origCount:468, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:469, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:470, fun:(function anonymous() {allElements[0].style.display = "table-row";})}, +{origCount:471, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:472, fun:(function anonymous() {allElements[8].style.position = "fixed";})}, +{origCount:473, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:474, fun:(function anonymous() {allElements[1].style.color = "red";})}, +{origCount:475, fun:(function anonymous() {allElements[9].style.height = "2em";})}, +{origCount:476, fun:(function anonymous() {allElements[7].style.display = "-moz-grid";})}, +{origCount:477, fun:(function anonymous() {allElements[0].style.height = "2em";})}, +{origCount:478, fun:(function anonymous() {allElements[6].style.position = "absolute";})}, +{origCount:479, fun:(function anonymous() {allElements[5].style.clear = "none";})}, +{origCount:480, fun:(function anonymous() {allElements[3].style.overflow = "hidden";})}, +{origCount:481, fun:(function anonymous() {allElements[3].style['float'] = "none";})}, +{origCount:482, fun:(function anonymous() {allElements[0].style['float'] = "none";})}, +{origCount:483, fun:(function anonymous() {allElements[11].style.height = "100px";})}, +{origCount:484, fun:(function anonymous() {allElements[3].style.display = "-moz-inline-grid";})}, +{origCount:485, fun:(function anonymous() {allElements[7].style.display = "block";})}, +{origCount:486, fun:(function anonymous() {allElements[3].style.visibility = "visible";})}, +{origCount:487, fun:(function anonymous() {allElements[9].style.clear = "left";})}, +{origCount:488, fun:(function anonymous() {allElements[5].style.width = "200%";})}, +{origCount:489, fun:(function anonymous() {allElements[8].style['float'] = "right";})}, +{origCount:490, fun:(function anonymous() {allElements[12].style.height = "100px";})}, +{origCount:491, fun:(function anonymous() {allElements[8].style.display = "-moz-deck";})}, +{origCount:492, fun:(function anonymous() {allElements[3].style.clear = "right";})}, +{origCount:493, fun:(function anonymous() {allElements[1].style['float'] = "none";})}, +{origCount:494, fun:(function anonymous() {allElements[8].style.overflow = "visible";})}, +{origCount:495, fun:(function anonymous() {allElements[4].style.height = "10%";})}, +{origCount:496, fun:(function anonymous() {allElements[7].style.color = "red";})}, +{origCount:497, fun:(function anonymous() {allElements[8].style.clear = "right";})}, +{origCount:498, fun:(function anonymous() {allElements[2].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:499, fun:(function anonymous() {allElements[5].style.height = "100px";})}, +{origCount:500, fun:(function anonymous() {allElements[11].style.clear = "none";})}, +{origCount:501, fun:(function anonymous() {allElements[12].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:502, fun:(function anonymous() {allElements[0].style.display = "-moz-grid";})}, +{origCount:503, fun:(function anonymous() {allElements[7].style.height = "100px";})}, +{origCount:504, fun:(function anonymous() {allElements[12].style.visibility = "visible";})}, +{origCount:505, fun:(function anonymous() {allElements[8].style.background = "#fcd";})}, +{origCount:506, fun:(function anonymous() {allElements[0].style.color = "black";})}, +{origCount:507, fun:(function anonymous() {allElements[6].style.overflow = "hidden";})}, +{origCount:508, fun:(function anonymous() {allElements[6].style.background = "transparent";})}, +{origCount:509, fun:(function anonymous() {allElements[5].style.color = "black";})}, +{origCount:510, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:511, fun:(function anonymous() {allElements[10].style.position = "fixed";})}, +{origCount:512, fun:(function anonymous() {allElements[0].style.clear = "right";})}, +{origCount:513, fun:(function anonymous() {allElements[11].style.display = "table-caption";})}, +{origCount:514, fun:(function anonymous() {allElements[10].style.clear = "right";})}, +{origCount:515, fun:(function anonymous() {allElements[1].style.visibility = "hidden";})}, +{origCount:516, fun:(function anonymous() {allElements[4].style.clear = "left";})}, +{origCount:517, fun:(function anonymous() {allElements[10].style['float'] = "none";})}, +{origCount:518, fun:(function anonymous() {allElements[12].style.overflow = "scroll";})}, +{origCount:519, fun:(function anonymous() {allElements[3].style.width = "1px";})}, +{origCount:520, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:521, fun:(function anonymous() {allElements[10].style.height = "200%";})}, +{origCount:522, fun:(function anonymous() {allElements[11].style.position = "relative";})}, +{origCount:523, fun:(function anonymous() {allElements[10].style.color = "black";})}, +{origCount:524, fun:(function anonymous() {allElements[11].style.background = "transparent";})}, +{origCount:525, fun:(function anonymous() {allElements[6].style.visibility = "collapse";})}, +{origCount:526, fun:(function anonymous() {allElements[3].style.background = "transparent";})}, +{origCount:527, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:528, fun:(function anonymous() {allElements[5].style.background = "transparent";})}, +{origCount:529, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:530, fun:(function anonymous() {allElements[8].style.height = "auto";})}, +{origCount:531, fun:(function anonymous() {allElements[9].style.background = "#fcd";})}, +{origCount:532, fun:(function anonymous() {allElements[4].style.height = "auto";})}, +{origCount:533, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:534, fun:(function anonymous() {allElements[10].style.width = "20em";})}, +{origCount:535, fun:(function anonymous() {allElements[6].style.position = "fixed";})}, +{origCount:536, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:537, fun:(function anonymous() {allElements[10].style.clear = "none";})}, +{origCount:538, fun:(function anonymous() {allElements[4].style.height = "auto";})}, +{origCount:539, fun:(function anonymous() {allElements[3].style.clear = "right";})}, +{origCount:540, fun:(function anonymous() {allElements[1].style.width = "200%";})}, +{origCount:541, fun:(function anonymous() {allElements[2].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:542, fun:(function anonymous() {allElements[12].style.clear = "left";})}, +{origCount:543, fun:(function anonymous() {allElements[10].style.visibility = "hidden";})}, +{origCount:544, fun:(function anonymous() {allElements[3].style.height = "auto";})}, +{origCount:545, fun:(function anonymous() {allElements[7].style.visibility = "collapse";})}, +{origCount:546, fun:(function anonymous() {allElements[4].style.width = "auto";})}, +{origCount:547, fun:(function anonymous() {allElements[10].style.height = "auto";})}, +{origCount:548, fun:(function anonymous() {allElements[6].style['float'] = "none";})}, +{origCount:549, fun:(function anonymous() {allElements[10].style.overflow = "auto";})}, +{origCount:550, fun:(function anonymous() {allElements[1].style.height = "auto";})}, +{origCount:551, fun:(function anonymous() {allElements[11].style.overflow = "hidden";})}, +{origCount:552, fun:(function anonymous() {allElements[6].style.background = "transparent";})}, +{origCount:553, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:554, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:555, fun:(function anonymous() {allElements[8].style.color = "green";})}, +{origCount:556, fun:(function anonymous() {allElements[10].style.background = "#fcd";})}, +{origCount:557, fun:(function anonymous() {allElements[0].style.overflow = "hidden";})}, +{origCount:558, fun:(function anonymous() {allElements[6].style.overflow = "hidden";})}, +{origCount:559, fun:(function anonymous() {allElements[10].style.clear = "right";})}, +{origCount:560, fun:(function anonymous() {allElements[3].style.background = "transparent";})}, +{origCount:561, fun:(function anonymous() {allElements[5].style.color = "green";})}, +{origCount:562, fun:(function anonymous() {allElements[6].style.position = "static";})}, +{origCount:563, fun:(function anonymous() {allElements[1].style.overflow = "hidden";})}, +{origCount:564, fun:(function anonymous() {allElements[6].style.display = "inline";})}, +{origCount:565, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:566, fun:(function anonymous() {allElements[7].style.visibility = "visible";})}, +{origCount:567, fun:(function anonymous() {allElements[1].style.color = "blue";})}, +{origCount:568, fun:(function anonymous() {allElements[1].style.clear = "both";})}, +{origCount:569, fun:(function anonymous() {allElements[0].style.position = "relative";})}, +{origCount:570, fun:(function anonymous() {allElements[5].style.height = "100px";})}, +{origCount:571, fun:(function anonymous() {allElements[6].style.height = "auto";})}, +{origCount:572, fun:(function anonymous() {allElements[10].style['float'] = "left";})}, +{origCount:573, fun:(function anonymous() {allElements[8].style.position = "absolute";})}, +{origCount:574, fun:(function anonymous() {allElements[7].style.background = "#fcd";})}, +{origCount:575, fun:(function anonymous() {allElements[12].style.display = "-moz-popup";})}, +{origCount:576, fun:(function anonymous() {allElements[2].style.position = "absolute";})}, +{origCount:577, fun:(function anonymous() {allElements[9].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:578, fun:(function anonymous() {allElements[11].style.overflow = "visible";})}, +{origCount:579, fun:(function anonymous() {allElements[2].style.display = "-moz-inline-grid";})}, +{origCount:580, fun:(function anonymous() {allElements[0].style.display = "-moz-popup";})}, +{origCount:581, fun:(function anonymous() {allElements[10].style['float'] = "right";})}, +{origCount:582, fun:(function anonymous() {allElements[12].style.height = "10%";})}, +{origCount:583, fun:(function anonymous() {allElements[10].style.position = "static";})}, +{origCount:584, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:585, fun:(function anonymous() {allElements[8].style.height = "auto";})}, +{origCount:586, fun:(function anonymous() {allElements[4].style.color = "green";})}, +{origCount:587, fun:(function anonymous() {allElements[7].style.color = "red";})}, +{origCount:588, fun:(function anonymous() {allElements[7].style.visibility = "collapse";})}, +{origCount:589, fun:(function anonymous() {allElements[11].style['float'] = "left";})}, +{origCount:590, fun:(function anonymous() {allElements[11].style.visibility = "hidden";})}, +{origCount:591, fun:(function anonymous() {allElements[12].style.overflow = "visible";})}, +{origCount:592, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:593, fun:(function anonymous() {allElements[2].style.display = "table-cell";})}, +{origCount:594, fun:(function anonymous() {allElements[1].style.color = "black";})}, +{origCount:595, fun:(function anonymous() {allElements[11].style.color = "green";})}, +{origCount:596, fun:(function anonymous() {allElements[9].style.color = "red";})}, +{origCount:597, fun:(function anonymous() {allElements[3].style['float'] = "none";})}, +{origCount:598, fun:(function anonymous() {allElements[10].style.display = "inline";})}, +{origCount:599, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:600, fun:(function anonymous() {allElements[7].style.width = "10%";})}, +{origCount:601, fun:(function anonymous() {allElements[9].style['float'] = "left";})}, +{origCount:602, fun:(function anonymous() {allElements[6].style.width = "10%";})}, +{origCount:603, fun:(function anonymous() {allElements[5].style.position = "absolute";})}, +{origCount:604, fun:(function anonymous() {allElements[11].style.position = "static";})}, +{origCount:605, fun:(function anonymous() {allElements[3].style.clear = "none";})}, +{origCount:606, fun:(function anonymous() {allElements[0].style['float'] = "right";})}, +{origCount:607, fun:(function anonymous() {allElements[6].style.position = "static";})}, +{origCount:608, fun:(function anonymous() {allElements[3].style.height = "2em";})}, +{origCount:609, fun:(function anonymous() {allElements[7].style.width = "20em";})}, +{origCount:610, fun:(function anonymous() {allElements[11].style.overflow = "scroll";})}, +{origCount:611, fun:(function anonymous() {allElements[8].style.position = "relative";})}, +{origCount:612, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:613, fun:(function anonymous() {allElements[3].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:614, fun:(function anonymous() {allElements[11].style.height = "auto";})}, +{origCount:615, fun:(function anonymous() {allElements[7].style['float'] = "right";})}, +{origCount:616, fun:(function anonymous() {allElements[10].style.overflow = "scroll";})}, +{origCount:617, fun:(function anonymous() {allElements[0].style.color = "green";})}, +{origCount:618, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:619, fun:(function anonymous() {allElements[11].style.height = "10%";})}, +{origCount:620, fun:(function anonymous() {allElements[4].style.height = "200%";})}, +{origCount:621, fun:(function anonymous() {allElements[6].style.display = "-moz-popup";})}, +{origCount:622, fun:(function anonymous() {allElements[8].style.position = "relative";})}, +{origCount:623, fun:(function anonymous() {allElements[3].style.width = "1px";})}, +{origCount:624, fun:(function anonymous() {allElements[8].style.height = "auto";})}, +{origCount:625, fun:(function anonymous() {allElements[5].style['float'] = "right";})}, +{origCount:626, fun:(function anonymous() {allElements[10].style.background = "transparent";})}, +{origCount:627, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:628, fun:(function anonymous() {allElements[5].style.display = "list-item";})}, +{origCount:629, fun:(function anonymous() {allElements[5].style.height = "100px";})}, +{origCount:630, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:631, fun:(function anonymous() {allElements[11].style.clear = "both";})}, +{origCount:632, fun:(function anonymous() {allElements[2].style.overflow = "visible";})}, +{origCount:633, fun:(function anonymous() {allElements[1].style.visibility = "hidden";})}, +{origCount:634, fun:(function anonymous() {allElements[1].style['float'] = "none";})}, +{origCount:635, fun:(function anonymous() {allElements[6].style.height = "2em";})}, +{origCount:636, fun:(function anonymous() {allElements[9].style.position = "relative";})}, +{origCount:637, fun:(function anonymous() {allElements[3].style.clear = "left";})}, +{origCount:638, fun:(function anonymous() {allElements[6].style.display = "table-header-group";})}, +{origCount:639, fun:(function anonymous() {allElements[10].style.display = "-moz-box";})}, +{origCount:640, fun:(function anonymous() {allElements[8].style.color = "blue";})}, +{origCount:641, fun:(function anonymous() {allElements[6].style.width = "200%";})}, +{origCount:642, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:643, fun:(function anonymous() {allElements[7].style.height = "10%";})}, +{origCount:644, fun:(function anonymous() {allElements[8].style.width = "1px";})}, +{origCount:645, fun:(function anonymous() {allElements[5].style.clear = "right";})}, +{origCount:646, fun:(function anonymous() {allElements[2].style.display = "table-row-group";})}, +{origCount:647, fun:(function anonymous() {allElements[4].style.color = "blue";})}, +{origCount:648, fun:(function anonymous() {allElements[5].style.color = "red";})}, +{origCount:649, fun:(function anonymous() {allElements[10].style.background = "transparent";})}, +{origCount:650, fun:(function anonymous() {allElements[10].style.visibility = "visible";})}, +{origCount:651, fun:(function anonymous() {allElements[12].style.height = "auto";})}, +{origCount:652, fun:(function anonymous() {allElements[7].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:653, fun:(function anonymous() {allElements[2].style.visibility = "visible";})}, +{origCount:654, fun:(function anonymous() {allElements[2].style.clear = "none";})}, +{origCount:655, fun:(function anonymous() {allElements[11].style.position = "relative";})}, +{origCount:656, fun:(function anonymous() {allElements[10].style.width = "200%";})}, +{origCount:657, fun:(function anonymous() {allElements[4].style.overflow = "scroll";})}, +{origCount:658, fun:(function anonymous() {allElements[12].style.clear = "none";})}, +{origCount:659, fun:(function anonymous() {allElements[12].style['float'] = "none";})}, +{origCount:660, fun:(function anonymous() {allElements[10].style.overflow = "scroll";})}, +{origCount:661, fun:(function anonymous() {allElements[12].style.clear = "left";})}, +{origCount:662, fun:(function anonymous() {allElements[10].style.clear = "right";})}, +{origCount:663, fun:(function anonymous() {allElements[9].style.clear = "none";})}, +{origCount:664, fun:(function anonymous() {allElements[2].style.overflow = "hidden";})}, +{origCount:665, fun:(function anonymous() {allElements[7].style.overflow = "visible";})}, +{origCount:666, fun:(function anonymous() {allElements[4].style.width = "1px";})}, +{origCount:667, fun:(function anonymous() {allElements[11].style.color = "blue";})}, +{origCount:668, fun:(function anonymous() {allElements[8].style.position = "relative";})}, +{origCount:669, fun:(function anonymous() {allElements[12].style.color = "black";})}, +{origCount:670, fun:(function anonymous() {allElements[4].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:671, fun:(function anonymous() {allElements[2].style['float'] = "right";})}, +{origCount:672, fun:(function anonymous() {allElements[10].style['float'] = "left";})}, +{origCount:673, fun:(function anonymous() {allElements[10].style.clear = "right";})}, +{origCount:674, fun:(function anonymous() {allElements[5].style.color = "black";})}, +{origCount:675, fun:(function anonymous() {allElements[2].style.clear = "right";})}, +{origCount:676, fun:(function anonymous() {allElements[5].style.height = "200%";})}, +{origCount:677, fun:(function anonymous() {allElements[8].style.position = "absolute";})}, +{origCount:678, fun:(function anonymous() {allElements[3].style.clear = "none";})}, +{origCount:679, fun:(function anonymous() {allElements[7].style.position = "relative";})}, +{origCount:680, fun:(function anonymous() {allElements[1].style.background = "transparent";})}, +{origCount:681, fun:(function anonymous() {allElements[3].style.position = "static";})}, +{origCount:682, fun:(function anonymous() {allElements[5].style['float'] = "left";})}, +{origCount:683, fun:(function anonymous() {allElements[0].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:684, fun:(function anonymous() {allElements[7].style.display = "-moz-grid-line";})}, +{origCount:685, fun:(function anonymous() {allElements[3].style.background = "transparent";})}, +{origCount:686, fun:(function anonymous() {allElements[9].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:687, fun:(function anonymous() {allElements[3].style.background = "#fcd";})}, +{origCount:688, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:689, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:690, fun:(function anonymous() {allElements[10].style.display = "table-cell";})}, +{origCount:691, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:692, fun:(function anonymous() {allElements[3].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:693, fun:(function anonymous() {allElements[3].style.height = "200%";})}, +{origCount:694, fun:(function anonymous() {allElements[2].style.height = "2em";})}, +{origCount:695, fun:(function anonymous() {allElements[8].style.clear = "both";})}, +{origCount:696, fun:(function anonymous() {allElements[11].style.clear = "none";})}, +{origCount:697, fun:(function anonymous() {allElements[6].style.clear = "right";})}, +{origCount:698, fun:(function anonymous() {allElements[9].style.color = "red";})}, +{origCount:699, fun:(function anonymous() {allElements[1].style['float'] = "left";})}, +{origCount:700, fun:(function anonymous() {allElements[12].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:701, fun:(function anonymous() {allElements[10].style.display = "-moz-deck";})}, +{origCount:702, fun:(function anonymous() {allElements[12].style.height = "auto";})}, +{origCount:703, fun:(function anonymous() {allElements[12].style.clear = "none";})}, +{origCount:704, fun:(function anonymous() {allElements[1].style.visibility = "hidden";})}, +{origCount:705, fun:(function anonymous() {allElements[11].style['float'] = "right";})}, +{origCount:706, fun:(function anonymous() {allElements[8].style.overflow = "hidden";})}, +{origCount:707, fun:(function anonymous() {allElements[11].style.display = "-moz-grid-group";})}, +{origCount:708, fun:(function anonymous() {allElements[12].style.color = "black";})}, +{origCount:709, fun:(function anonymous() {allElements[4].style.clear = "right";})}, +{origCount:710, fun:(function anonymous() {allElements[4].style['float'] = "right";})}, +{origCount:711, fun:(function anonymous() {allElements[7].style.height = "auto";})}, +{origCount:712, fun:(function anonymous() {allElements[2].style.clear = "left";})}, +{origCount:713, fun:(function anonymous() {allElements[11].style.clear = "right";})}, +{origCount:714, fun:(function anonymous() {allElements[11].style.display = "table-header-group";})}, +{origCount:715, fun:(function anonymous() {allElements[8].style.height = "2em";})}, +{origCount:716, fun:(function anonymous() {allElements[7].style.color = "green";})}, +{origCount:717, fun:(function anonymous() {allElements[1].style.width = "auto";})}, +{origCount:718, fun:(function anonymous() {allElements[9].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:719, fun:(function anonymous() {allElements[10].style.height = "2em";})}, +{origCount:720, fun:(function anonymous() {allElements[8].style.width = "auto";})}, +{origCount:721, fun:(function anonymous() {allElements[10].style.background = "#fcd";})}, +{origCount:722, fun:(function anonymous() {allElements[9].style.display = "table-row-group";})}, +{origCount:723, fun:(function anonymous() {allElements[8].style.overflow = "scroll";})}, +{origCount:724, fun:(function anonymous() {allElements[2].style.display = "table-caption";})}, +{origCount:725, fun:(function anonymous() {allElements[7].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:726, fun:(function anonymous() {allElements[5].style.visibility = "collapse";})}, +{origCount:727, fun:(function anonymous() {allElements[12].style.position = "absolute";})}, +{origCount:728, fun:(function anonymous() {allElements[9].style.color = "red";})}, +{origCount:729, fun:(function anonymous() {allElements[1].style.display = "table-row";})}, +{origCount:730, fun:(function anonymous() {allElements[6].style.color = "black";})}, +{origCount:731, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:732, fun:(function anonymous() {allElements[0].style.color = "black";})}, +{origCount:733, fun:(function anonymous() {allElements[0].style.clear = "both";})}, +{origCount:734, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:735, fun:(function anonymous() {allElements[5].style.width = "20em";})}, +{origCount:736, fun:(function anonymous() {allElements[9].style['float'] = "left";})}, +{origCount:737, fun:(function anonymous() {allElements[12].style.height = "10%";})}, +{origCount:738, fun:(function anonymous() {allElements[7].style.height = "10%";})}, +{origCount:739, fun:(function anonymous() {allElements[12].style.color = "black";})}, +{origCount:740, fun:(function anonymous() {allElements[7].style.visibility = "hidden";})}, +{origCount:741, fun:(function anonymous() {allElements[9].style.visibility = "collapse";})}, +{origCount:742, fun:(function anonymous() {allElements[11].style.display = "-moz-inline-grid";})}, +{origCount:743, fun:(function anonymous() {allElements[7].style.position = "static";})}, +{origCount:744, fun:(function anonymous() {allElements[0].style.display = "-moz-box";})}, +{origCount:745, fun:(function anonymous() {allElements[11].style.clear = "both";})}, +{origCount:746, fun:(function anonymous() {allElements[4].style.position = "fixed";})}, +{origCount:747, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:748, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:749, fun:(function anonymous() {allElements[0].style.width = "1px";})}, +{origCount:750, fun:(function anonymous() {allElements[6].style.visibility = "hidden";})}, +{origCount:751, fun:(function anonymous() {allElements[8].style.position = "absolute";})}, +{origCount:752, fun:(function anonymous() {allElements[0].style.color = "green";})}, +{origCount:753, fun:(function anonymous() {allElements[0].style.clear = "both";})}, +{origCount:754, fun:(function anonymous() {allElements[0].style.overflow = "auto";})}, +{origCount:755, fun:(function anonymous() {allElements[6].style.clear = "left";})}, +{origCount:756, fun:(function anonymous() {allElements[10].style.position = "static";})}, +{origCount:757, fun:(function anonymous() {allElements[4].style.background = "#fcd";})}, +{origCount:758, fun:(function anonymous() {allElements[8].style.color = "black";})}, +{origCount:759, fun:(function anonymous() {allElements[0].style.position = "relative";})}, +{origCount:760, fun:(function anonymous() {allElements[12].style.overflow = "auto";})}, +{origCount:761, fun:(function anonymous() {allElements[10].style.visibility = "hidden";})}, +{origCount:762, fun:(function anonymous() {allElements[0].style.visibility = "collapse";})}, +{origCount:763, fun:(function anonymous() {allElements[12].style.height = "100px";})}, +{origCount:764, fun:(function anonymous() {allElements[2].style.overflow = "visible";})}, +{origCount:765, fun:(function anonymous() {allElements[12].style.overflow = "auto";})}, +{origCount:766, fun:(function anonymous() {allElements[10].style.position = "fixed";})}, +{origCount:767, fun:(function anonymous() {allElements[0].style.overflow = "hidden";})}, +{origCount:768, fun:(function anonymous() {allElements[1].style.display = "table-cell";})}, +{origCount:769, fun:(function anonymous() {allElements[7].style.clear = "both";})}, +{origCount:770, fun:(function anonymous() {allElements[8].style.position = "relative";})}, +{origCount:771, fun:(function anonymous() {allElements[10].style.color = "red";})}, +{origCount:772, fun:(function anonymous() {allElements[6].style.display = "-moz-inline-box";})}, +{origCount:773, fun:(function anonymous() {allElements[2].style.overflow = "hidden";})}, +{origCount:774, fun:(function anonymous() {allElements[2].style['float'] = "none";})}, +{origCount:775, fun:(function anonymous() {allElements[0].style.clear = "left";})}, +{origCount:776, fun:(function anonymous() {allElements[12].style.display = "table-cell";})}, +{origCount:777, fun:(function anonymous() {allElements[7].style.background = "transparent";})}, +{origCount:778, fun:(function anonymous() {allElements[2].style['float'] = "right";})}, +{origCount:779, fun:(function anonymous() {allElements[3].style.overflow = "scroll";})}, +{origCount:780, fun:(function anonymous() {allElements[2].style.width = "1px";})}, +{origCount:781, fun:(function anonymous() {allElements[4].style.clear = "both";})}, +{origCount:782, fun:(function anonymous() {allElements[3].style.height = "auto";})}, +{origCount:783, fun:(function anonymous() {allElements[3].style.color = "green";})}, +{origCount:784, fun:(function anonymous() {allElements[10].style.color = "red";})}, +{origCount:785, fun:(function anonymous() {allElements[3].style.position = "static";})}, +{origCount:786, fun:(function anonymous() {allElements[1].style.position = "absolute";})}, +{origCount:787, fun:(function anonymous() {allElements[8].style.height = "100px";})}, +{origCount:788, fun:(function anonymous() {allElements[6].style.overflow = "scroll";})}, +{origCount:789, fun:(function anonymous() {allElements[11].style.position = "relative";})}, +{origCount:790, fun:(function anonymous() {allElements[3].style.display = "-moz-grid-line";})}, +{origCount:791, fun:(function anonymous() {allElements[2].style.visibility = "collapse";})}, +{origCount:792, fun:(function anonymous() {allElements[11].style['float'] = "none";})}, +{origCount:793, fun:(function anonymous() {allElements[11].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:794, fun:(function anonymous() {allElements[7].style['float'] = "right";})}, +{origCount:795, fun:(function anonymous() {allElements[5].style.display = "table-column";})}, +{origCount:796, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:797, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:798, fun:(function anonymous() {allElements[8].style.position = "static";})}, +{origCount:799, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:800, fun:(function anonymous() {allElements[8].style.overflow = "visible";})}, +{origCount:801, fun:(function anonymous() {allElements[10].style.height = "100px";})}, +{origCount:802, fun:(function anonymous() {allElements[0].style.clear = "right";})}, +{origCount:803, fun:(function anonymous() {allElements[9].style.color = "black";})}, +{origCount:804, fun:(function anonymous() {allElements[3].style.width = "1px";})}, +{origCount:805, fun:(function anonymous() {allElements[0].style.clear = "none";})}, +{origCount:806, fun:(function anonymous() {allElements[7].style.width = "200%";})}, +{origCount:807, fun:(function anonymous() {allElements[2].style.overflow = "visible";})}, +{origCount:808, fun:(function anonymous() {allElements[4].style.overflow = "visible";})}, +{origCount:809, fun:(function anonymous() {allElements[5].style.display = "table-row";})}, +{origCount:810, fun:(function anonymous() {allElements[10].style.clear = "none";})}, +{origCount:811, fun:(function anonymous() {allElements[0].style.color = "red";})}, +{origCount:812, fun:(function anonymous() {allElements[5].style.clear = "right";})}, +{origCount:813, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:814, fun:(function anonymous() {allElements[6].style.background = "#fcd";})}, +{origCount:815, fun:(function anonymous() {allElements[12].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:816, fun:(function anonymous() {allElements[3].style.visibility = "visible";})}, +{origCount:817, fun:(function anonymous() {allElements[11].style.clear = "none";})}, +{origCount:818, fun:(function anonymous() {allElements[2].style.visibility = "visible";})}, +{origCount:819, fun:(function anonymous() {allElements[8].style.position = "relative";})}, +{origCount:820, fun:(function anonymous() {allElements[7].style.height = "auto";})}, +{origCount:821, fun:(function anonymous() {allElements[5].style.clear = "both";})}, +{origCount:822, fun:(function anonymous() {allElements[9].style.overflow = "auto";})}, +{origCount:823, fun:(function anonymous() {allElements[9].style.position = "static";})}, +{origCount:824, fun:(function anonymous() {allElements[11].style.position = "absolute";})}, +{origCount:825, fun:(function anonymous() {allElements[9].style.width = "200%";})}, +{origCount:826, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:827, fun:(function anonymous() {allElements[11].style.position = "static";})}, +{origCount:828, fun:(function anonymous() {allElements[0].style.overflow = "hidden";})}, +{origCount:829, fun:(function anonymous() {allElements[5].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:830, fun:(function anonymous() {allElements[6].style.position = "fixed";})}, +{origCount:831, fun:(function anonymous() {allElements[9].style['float'] = "right";})}, +{origCount:832, fun:(function anonymous() {allElements[6].style['float'] = "none";})}, +{origCount:833, fun:(function anonymous() {allElements[2].style.background = "transparent";})}, +{origCount:834, fun:(function anonymous() {allElements[3].style.overflow = "scroll";})}, +{origCount:835, fun:(function anonymous() {allElements[0].style.height = "auto";})}, +{origCount:836, fun:(function anonymous() {allElements[0].style.position = "static";})}, +{origCount:837, fun:(function anonymous() {allElements[8].style.display = "-moz-grid-line";})}, +{origCount:838, fun:(function anonymous() {allElements[4].style.height = "10%";})}, +{origCount:839, fun:(function anonymous() {allElements[5].style.width = "1px";})}, +{origCount:840, fun:(function anonymous() {allElements[4].style.position = "fixed";})}, +{origCount:841, fun:(function anonymous() {allElements[7].style.clear = "none";})}, +{origCount:842, fun:(function anonymous() {allElements[6].style.display = "table-column";})}, +{origCount:843, fun:(function anonymous() {allElements[7].style.visibility = "visible";})}, +{origCount:844, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:845, fun:(function anonymous() {allElements[7].style.height = "2em";})}, +{origCount:846, fun:(function anonymous() {allElements[5].style.display = "table-column";})}, +{origCount:847, fun:(function anonymous() {allElements[0].style.clear = "both";})}, +{origCount:848, fun:(function anonymous() {allElements[11].style['float'] = "right";})}, +{origCount:849, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:850, fun:(function anonymous() {allElements[9].style.overflow = "scroll";})}, +{origCount:851, fun:(function anonymous() {allElements[8].style.height = "200%";})}, +{origCount:852, fun:(function anonymous() {allElements[5].style.height = "200%";})}, +{origCount:853, fun:(function anonymous() {allElements[5].style.clear = "none";})}, +{origCount:854, fun:(function anonymous() {allElements[2].style.background = "#fcd";})}, +{origCount:855, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:856, fun:(function anonymous() {allElements[4].style.clear = "both";})}, +{origCount:857, fun:(function anonymous() {allElements[8].style.width = "10%";})}, +{origCount:858, fun:(function anonymous() {allElements[4].style.color = "red";})}, +{origCount:859, fun:(function anonymous() {allElements[9].style.height = "10%";})}, +{origCount:860, fun:(function anonymous() {allElements[4].style.visibility = "hidden";})}, +{origCount:861, fun:(function anonymous() {allElements[7].style.clear = "left";})}, +{origCount:862, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:863, fun:(function anonymous() {allElements[7].style.color = "green";})}, +{origCount:864, fun:(function anonymous() {allElements[1].style.clear = "left";})}, +{origCount:865, fun:(function anonymous() {allElements[12].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:866, fun:(function anonymous() {allElements[6].style.width = "auto";})}, +{origCount:867, fun:(function anonymous() {allElements[1].style.height = "100px";})}, +{origCount:868, fun:(function anonymous() {allElements[3].style.display = "-moz-inline-block";})}, +{origCount:869, fun:(function anonymous() {allElements[5].style.visibility = "visible";})}, +{origCount:870, fun:(function anonymous() {allElements[11].style.color = "blue";})}, +{origCount:871, fun:(function anonymous() {allElements[1].style.position = "static";})}, +{origCount:872, fun:(function anonymous() {allElements[6].style.visibility = "visible";})}, +{origCount:873, fun:(function anonymous() {allElements[7].style.color = "red";})}, +{origCount:874, fun:(function anonymous() {allElements[8].style.color = "blue";})}, +{origCount:875, fun:(function anonymous() {allElements[1].style['float'] = "right";})}, +{origCount:876, fun:(function anonymous() {allElements[6].style['float'] = "right";})}, +{origCount:877, fun:(function anonymous() {allElements[1].style.clear = "left";})}, +{origCount:878, fun:(function anonymous() {allElements[6].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:879, fun:(function anonymous() {allElements[11].style.display = "inline";})}, +{origCount:880, fun:(function anonymous() {allElements[11].style['float'] = "none";})}, +{origCount:881, fun:(function anonymous() {allElements[10].style.color = "black";})}, +{origCount:882, fun:(function anonymous() {allElements[0].style.visibility = "hidden";})}, +{origCount:883, fun:(function anonymous() {allElements[1].style.color = "green";})}, +{origCount:884, fun:(function anonymous() {allElements[4].style.height = "10%";})}, +{origCount:885, fun:(function anonymous() {allElements[2].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:886, fun:(function anonymous() {allElements[0].style.display = "list-item";})}, +{origCount:887, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:888, fun:(function anonymous() {allElements[6].style.overflow = "hidden";})}, +{origCount:889, fun:(function anonymous() {allElements[12].style.clear = "left";})}, +{origCount:890, fun:(function anonymous() {allElements[1].style.clear = "none";})}, +{origCount:891, fun:(function anonymous() {allElements[4].style.clear = "left";})}, +{origCount:892, fun:(function anonymous() {allElements[1].style.position = "relative";})}, +{origCount:893, fun:(function anonymous() {allElements[11].style.position = "absolute";})}, +{origCount:894, fun:(function anonymous() {allElements[12].style.background = "#fcd";})}, +{origCount:895, fun:(function anonymous() {allElements[10].style.position = "relative";})}, +{origCount:896, fun:(function anonymous() {allElements[10].style.display = "-moz-box";})}, +{origCount:897, fun:(function anonymous() {allElements[6].style.position = "fixed";})}, +{origCount:898, fun:(function anonymous() {allElements[1].style.overflow = "scroll";})}, +{origCount:899, fun:(function anonymous() {allElements[3].style.width = "10%";})}, +{origCount:900, fun:(function anonymous() {allElements[3].style.background = "transparent";})}, +{origCount:901, fun:(function anonymous() {allElements[6].style.background = "transparent";})}, +{origCount:902, fun:(function anonymous() {allElements[5].style.visibility = "visible";})}, +{origCount:903, fun:(function anonymous() {allElements[6].style.background = "#fcd";})}, +{origCount:904, fun:(function anonymous() {allElements[0].style.overflow = "scroll";})}, +{origCount:905, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:906, fun:(function anonymous() {allElements[6].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:907, fun:(function anonymous() {allElements[1].style.height = "200%";})}, +{origCount:908, fun:(function anonymous() {allElements[12].style.display = "table-row";})}, +{origCount:909, fun:(function anonymous() {allElements[5].style.height = "10%";})}, +{origCount:910, fun:(function anonymous() {allElements[11].style.position = "relative";})}, +{origCount:911, fun:(function anonymous() {allElements[10].style.display = "-moz-stack";})}, +{origCount:912, fun:(function anonymous() {allElements[7].style.color = "green";})}, +{origCount:913, fun:(function anonymous() {allElements[8].style.clear = "left";})}, +{origCount:914, fun:(function anonymous() {allElements[5].style.clear = "right";})}, +{origCount:915, fun:(function anonymous() {allElements[3].style['float'] = "left";})}, +{origCount:916, fun:(function anonymous() {allElements[8].style.display = "table-header-group";})}, +{origCount:917, fun:(function anonymous() {allElements[12].style.display = "-moz-grid-group";})}, +{origCount:918, fun:(function anonymous() {allElements[8].style.position = "fixed";})}, +{origCount:919, fun:(function anonymous() {allElements[1].style.clear = "none";})}, +{origCount:920, fun:(function anonymous() {allElements[10].style.height = "10%";})}, +{origCount:921, fun:(function anonymous() {allElements[0].style['float'] = "left";})}, +{origCount:922, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:923, fun:(function anonymous() {allElements[0].style.display = "-moz-inline-grid";})}, +{origCount:924, fun:(function anonymous() {allElements[8].style.clear = "left";})}, +{origCount:925, fun:(function anonymous() {allElements[6].style.clear = "right";})}, +{origCount:926, fun:(function anonymous() {allElements[0].style.overflow = "hidden";})}, +{origCount:927, fun:(function anonymous() {allElements[9].style.height = "100px";})}, +{origCount:928, fun:(function anonymous() {allElements[11].style.color = "blue";})}, +{origCount:929, fun:(function anonymous() {allElements[0].style.clear = "left";})}, +{origCount:930, fun:(function anonymous() {allElements[6].style.background = "#fcd";})}, +{origCount:931, fun:(function anonymous() {allElements[10].style['float'] = "none";})}, +{origCount:932, fun:(function anonymous() {allElements[3].style.display = "-moz-inline-box";})}, +{origCount:933, fun:(function anonymous() {allElements[4].style.width = "1px";})}, +{origCount:934, fun:(function anonymous() {allElements[5].style.display = "table-row";})}, +{origCount:935, fun:(function anonymous() {allElements[12].style.height = "2em";})}, +{origCount:936, fun:(function anonymous() {allElements[4].style.visibility = "collapse";})}, +{origCount:937, fun:(function anonymous() {allElements[0].style.background = "transparent";})}, +{origCount:938, fun:(function anonymous() {allElements[4].style.background = "#fcd";})}, +{origCount:939, fun:(function anonymous() {allElements[11].style.overflow = "scroll";})}, +{origCount:940, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:941, fun:(function anonymous() {allElements[10].style.background = "#fcd";})}, +{origCount:942, fun:(function anonymous() {allElements[0].style.width = "20em";})}, +{origCount:943, fun:(function anonymous() {allElements[1].style.overflow = "scroll";})}, +{origCount:944, fun:(function anonymous() {allElements[5].style.clear = "left";})}, +{origCount:945, fun:(function anonymous() {allElements[3].style.display = "table";})}, +{origCount:946, fun:(function anonymous() {allElements[2].style.display = "table-footer-group";})}, +{origCount:947, fun:(function anonymous() {allElements[6].style.visibility = "visible";})}, +{origCount:948, fun:(function anonymous() {allElements[9].style.display = "-moz-inline-block";})}, +{origCount:949, fun:(function anonymous() {allElements[2].style.clear = "right";})}, +{origCount:950, fun:(function anonymous() {allElements[4].style.overflow = "visible";})}, +{origCount:951, fun:(function anonymous() {allElements[8].style.width = "200%";})}, +{origCount:952, fun:(function anonymous() {allElements[5].style.overflow = "hidden";})}, +{origCount:953, fun:(function anonymous() {allElements[2].style.height = "auto";})}, +{origCount:954, fun:(function anonymous() {allElements[3].style.overflow = "visible";})}, +{origCount:955, fun:(function anonymous() {allElements[2].style.color = "blue";})}, +{origCount:956, fun:(function anonymous() {allElements[2].style.width = "10%";})}, +{origCount:957, fun:(function anonymous() {allElements[11].style.visibility = "collapse";})}, +{origCount:958, fun:(function anonymous() {allElements[7].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:959, fun:(function anonymous() {allElements[9].style.position = "fixed";})}, +{origCount:960, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:961, fun:(function anonymous() {allElements[0].style.clear = "right";})}, +{origCount:962, fun:(function anonymous() {allElements[0].style['float'] = "left";})}, +{origCount:963, fun:(function anonymous() {allElements[1].style.width = "1px";})}, +{origCount:964, fun:(function anonymous() {allElements[9].style.height = "2em";})}, +{origCount:965, fun:(function anonymous() {allElements[3].style.width = "20em";})}, +{origCount:966, fun:(function anonymous() {allElements[1].style.width = "200%";})}, +{origCount:967, fun:(function anonymous() {allElements[10].style.overflow = "hidden";})}, +{origCount:968, fun:(function anonymous() {allElements[9].style.clear = "both";})}, +{origCount:969, fun:(function anonymous() {allElements[2].style.clear = "both";})}, +{origCount:970, fun:(function anonymous() {allElements[9].style['float'] = "left";})}, +{origCount:971, fun:(function anonymous() {allElements[8].style.clear = "left";})}, +{origCount:972, fun:(function anonymous() {allElements[6].style.height = "auto";})}, +{origCount:973, fun:(function anonymous() {allElements[7].style.background = "#fcd";})}, +{origCount:974, fun:(function anonymous() {allElements[4].style.clear = "none";})}, +{origCount:975, fun:(function anonymous() {allElements[2].style.position = "relative";})}, +{origCount:976, fun:(function anonymous() {allElements[8].style['float'] = "left";})}, +{origCount:977, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:978, fun:(function anonymous() {allElements[8].style.height = "100px";})}, +{origCount:979, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:980, fun:(function anonymous() {allElements[11].style.clear = "left";})}, +{origCount:981, fun:(function anonymous() {allElements[1].style.color = "blue";})}, +{origCount:982, fun:(function anonymous() {allElements[6].style.height = "100px";})}, +{origCount:983, fun:(function anonymous() {allElements[2].style.overflow = "scroll";})}, +{origCount:984, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:985, fun:(function anonymous() {allElements[9].style.clear = "both";})}, +{origCount:986, fun:(function anonymous() {allElements[4].style.height = "10%";})}, +{origCount:987, fun:(function anonymous() {allElements[0].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:988, fun:(function anonymous() {allElements[2].style.background = "transparent";})}, +{origCount:989, fun:(function anonymous() {allElements[4].style.color = "green";})}, +{origCount:990, fun:(function anonymous() {allElements[11].style.color = "green";})}, +{origCount:991, fun:(function anonymous() {allElements[2].style.clear = "left";})}, +{origCount:992, fun:(function anonymous() {allElements[8].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:993, fun:(function anonymous() {allElements[10].style.background = "transparent";})}, +{origCount:994, fun:(function anonymous() {allElements[11].style.overflow = "auto";})}, +{origCount:995, fun:(function anonymous() {allElements[5].style.overflow = "visible";})}, +{origCount:996, fun:(function anonymous() {allElements[11].style.visibility = "collapse";})}, +{origCount:997, fun:(function anonymous() {allElements[7].style.clear = "both";})}, +{origCount:998, fun:(function anonymous() {allElements[12].style.position = "fixed";})}, +{origCount:999, fun:(function anonymous() {allElements[5].style.color = "green";})}, +{origCount:1000, fun:(function anonymous() {allElements[6].style.display = "-moz-box";})}, +{origCount:1001, fun:(function anonymous() {allElements[5].style.overflow = "auto";})}, +{origCount:1002, fun:(function anonymous() {allElements[9].style.height = "2em";})}, +{origCount:1003, fun:(function anonymous() {allElements[11].style['float'] = "left";})}, +{origCount:1004, fun:(function anonymous() {allElements[2].style['float'] = "none";})}, +{origCount:1005, fun:(function anonymous() {allElements[0].style.overflow = "scroll";})}, +{origCount:1006, fun:(function anonymous() {allElements[12].style.background = "transparent";})}, +{origCount:1007, fun:(function anonymous() {allElements[4].style.visibility = "hidden";})}, +{origCount:1008, fun:(function anonymous() {allElements[7].style.overflow = "scroll";})}, +{origCount:1009, fun:(function anonymous() {allElements[1].style.width = "auto";})}, +{origCount:1010, fun:(function anonymous() {allElements[3].style.overflow = "hidden";})}, +{origCount:1011, fun:(function anonymous() {allElements[7].style.display = "table-header-group";})}, +{origCount:1012, fun:(function anonymous() {allElements[5].style.display = "-moz-box";})}, +{origCount:1013, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:1014, fun:(function anonymous() {allElements[3].style.height = "auto";})}, +{origCount:1015, fun:(function anonymous() {allElements[2].style.overflow = "auto";})}, +{origCount:1016, fun:(function anonymous() {allElements[3].style['float'] = "right";})}, +{origCount:1017, fun:(function anonymous() {allElements[0].style.height = "2em";})}, +{origCount:1018, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:1019, fun:(function anonymous() {allElements[11].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1020, fun:(function anonymous() {allElements[12].style.visibility = "hidden";})}, +{origCount:1021, fun:(function anonymous() {allElements[3].style.clear = "both";})}, +{origCount:1022, fun:(function anonymous() {allElements[3].style.visibility = "visible";})}, +{origCount:1023, fun:(function anonymous() {allElements[4].style.overflow = "auto";})}, +{origCount:1024, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:1025, fun:(function anonymous() {allElements[7].style.display = "table";})}, +{origCount:1026, fun:(function anonymous() {allElements[6].style.color = "blue";})}, +{origCount:1027, fun:(function anonymous() {allElements[2].style.color = "black";})}, +{origCount:1028, fun:(function anonymous() {allElements[1].style.color = "black";})}, +{origCount:1029, fun:(function anonymous() {allElements[8].style['float'] = "right";})}, +{origCount:1030, fun:(function anonymous() {allElements[2].style.display = "-moz-grid-group";})}, +{origCount:1031, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:1032, fun:(function anonymous() {allElements[12].style.height = "auto";})}, +{origCount:1033, fun:(function anonymous() {allElements[1].style.clear = "both";})}, +{origCount:1034, fun:(function anonymous() {allElements[11].style.width = "auto";})}, +{origCount:1035, fun:(function anonymous() {allElements[10].style.position = "relative";})}, +{origCount:1036, fun:(function anonymous() {allElements[3].style.position = "fixed";})}, +{origCount:1037, fun:(function anonymous() {allElements[8].style.clear = "both";})}, +{origCount:1038, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:1039, fun:(function anonymous() {allElements[11].style.overflow = "auto";})}, +{origCount:1040, fun:(function anonymous() {allElements[7].style.height = "200%";})}, +{origCount:1041, fun:(function anonymous() {allElements[11].style.width = "200%";})}, +{origCount:1042, fun:(function anonymous() {allElements[3].style.overflow = "visible";})}, +{origCount:1043, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:1044, fun:(function anonymous() {allElements[8].style.clear = "none";})}, +{origCount:1045, fun:(function anonymous() {allElements[7].style.width = "10%";})}, +{origCount:1046, fun:(function anonymous() {allElements[2].style.height = "100px";})}, +{origCount:1047, fun:(function anonymous() {allElements[12].style.clear = "left";})}, +{origCount:1048, fun:(function anonymous() {allElements[2].style.overflow = "visible";})}, +{origCount:1049, fun:(function anonymous() {allElements[4].style.background = "transparent";})}, +{origCount:1050, fun:(function anonymous() {allElements[11].style['float'] = "none";})}, +{origCount:1051, fun:(function anonymous() {allElements[3].style['float'] = "right";})}, +{origCount:1052, fun:(function anonymous() {allElements[9].style.height = "auto";})}, +{origCount:1053, fun:(function anonymous() {allElements[11].style.display = "-moz-grid";})}, +{origCount:1054, fun:(function anonymous() {allElements[0].style.position = "fixed";})}, +{origCount:1055, fun:(function anonymous() {allElements[7].style.width = "20em";})}, +{origCount:1056, fun:(function anonymous() {allElements[0].style.height = "100px";})}, +{origCount:1057, fun:(function anonymous() {allElements[10].style.clear = "none";})}, +{origCount:1058, fun:(function anonymous() {allElements[2].style.width = "10%";})}, +{origCount:1059, fun:(function anonymous() {allElements[9].style.visibility = "collapse";})}, +{origCount:1060, fun:(function anonymous() {allElements[10].style.display = "-moz-inline-stack";})}, +{origCount:1061, fun:(function anonymous() {allElements[10].style.height = "200%";})}, +{origCount:1062, fun:(function anonymous() {allElements[1].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1063, fun:(function anonymous() {allElements[3].style.clear = "right";})}, +{origCount:1064, fun:(function anonymous() {allElements[7].style.overflow = "auto";})}, +{origCount:1065, fun:(function anonymous() {allElements[6].style.visibility = "visible";})}, +{origCount:1066, fun:(function anonymous() {allElements[5].style['float'] = "right";})}, +{origCount:1067, fun:(function anonymous() {allElements[11].style.height = "200%";})}, +{origCount:1068, fun:(function anonymous() {allElements[1].style.position = "static";})}, +{origCount:1069, fun:(function anonymous() {allElements[8].style.clear = "none";})}, +{origCount:1070, fun:(function anonymous() {allElements[11].style.display = "-moz-groupbox";})}, +{origCount:1071, fun:(function anonymous() {allElements[2].style.visibility = "visible";})}, +{origCount:1072, fun:(function anonymous() {allElements[0].style.background = "transparent";})}, +{origCount:1073, fun:(function anonymous() {allElements[10].style.width = "auto";})}, +{origCount:1074, fun:(function anonymous() {allElements[12].style.clear = "right";})}, +{origCount:1075, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:1076, fun:(function anonymous() {allElements[0].style.width = "200%";})}, +{origCount:1077, fun:(function anonymous() {allElements[10].style.clear = "left";})}, +{origCount:1078, fun:(function anonymous() {allElements[7].style.display = "-moz-deck";})}, +{origCount:1079, fun:(function anonymous() {allElements[9].style.color = "green";})}, +{origCount:1080, fun:(function anonymous() {allElements[10].style.color = "black";})}, +{origCount:1081, fun:(function anonymous() {allElements[1].style.width = "200%";})}, +{origCount:1082, fun:(function anonymous() {allElements[2].style.position = "fixed";})}, +{origCount:1083, fun:(function anonymous() {allElements[3].style.height = "100px";})}, +{origCount:1084, fun:(function anonymous() {allElements[12].style.background = "#fcd";})}, +{origCount:1085, fun:(function anonymous() {allElements[7].style.visibility = "collapse";})}, +{origCount:1086, fun:(function anonymous() {allElements[6].style.clear = "both";})}, +{origCount:1087, fun:(function anonymous() {allElements[3].style.overflow = "visible";})}, +{origCount:1088, fun:(function anonymous() {allElements[2].style.width = "10%";})}, +{origCount:1089, fun:(function anonymous() {allElements[9].style.color = "red";})}, +{origCount:1090, fun:(function anonymous() {allElements[3].style.display = "-moz-inline-stack";})}, +{origCount:1091, fun:(function anonymous() {allElements[4].style['float'] = "right";})}, +{origCount:1092, fun:(function anonymous() {allElements[2].style.overflow = "visible";})}, +{origCount:1093, fun:(function anonymous() {allElements[4].style.clear = "none";})}, +{origCount:1094, fun:(function anonymous() {allElements[1].style.display = "table-row";})}, +{origCount:1095, fun:(function anonymous() {allElements[1].style.display = "-moz-deck";})}, +{origCount:1096, fun:(function anonymous() {allElements[7].style.overflow = "visible";})}, +{origCount:1097, fun:(function anonymous() {allElements[12].style.color = "black";})}, +{origCount:1098, fun:(function anonymous() {allElements[9].style.width = "20em";})}, +{origCount:1099, fun:(function anonymous() {allElements[3].style.color = "green";})}, +{origCount:1100, fun:(function anonymous() {allElements[0].style.overflow = "auto";})}, +{origCount:1101, fun:(function anonymous() {allElements[4].style.background = "#fcd";})}, +{origCount:1102, fun:(function anonymous() {allElements[9].style.background = "#fcd";})}, +{origCount:1103, fun:(function anonymous() {allElements[7].style.clear = "none";})}, +{origCount:1104, fun:(function anonymous() {allElements[2].style['float'] = "none";})}, +{origCount:1105, fun:(function anonymous() {allElements[2].style.clear = "none";})}, +{origCount:1106, fun:(function anonymous() {allElements[10].style.color = "blue";})}, +{origCount:1107, fun:(function anonymous() {allElements[7].style.clear = "none";})}, +{origCount:1108, fun:(function anonymous() {allElements[10].style.height = "10%";})}, +{origCount:1109, fun:(function anonymous() {allElements[0].style.overflow = "scroll";})}, +{origCount:1110, fun:(function anonymous() {allElements[7].style.display = "-moz-grid-group";})}, +{origCount:1111, fun:(function anonymous() {allElements[12].style.overflow = "visible";})}, +{origCount:1112, fun:(function anonymous() {allElements[6].style.width = "20em";})}, +{origCount:1113, fun:(function anonymous() {allElements[8].style.overflow = "auto";})}, +{origCount:1114, fun:(function anonymous() {allElements[10].style['float'] = "none";})}, +{origCount:1115, fun:(function anonymous() {allElements[5].style.width = "auto";})}, +{origCount:1116, fun:(function anonymous() {allElements[11].style.display = "table-caption";})}, +{origCount:1117, fun:(function anonymous() {allElements[8].style.width = "200%";})}, +{origCount:1118, fun:(function anonymous() {allElements[1].style.width = "1px";})}, +{origCount:1119, fun:(function anonymous() {allElements[8].style.background = "transparent";})}, +{origCount:1120, fun:(function anonymous() {allElements[9].style['float'] = "none";})}, +{origCount:1121, fun:(function anonymous() {allElements[9].style['float'] = "none";})}, +{origCount:1122, fun:(function anonymous() {allElements[1].style.display = "list-item";})}, +{origCount:1123, fun:(function anonymous() {allElements[3].style['float'] = "none";})}, +{origCount:1124, fun:(function anonymous() {allElements[8].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1125, fun:(function anonymous() {allElements[7].style.height = "auto";})}, +{origCount:1126, fun:(function anonymous() {allElements[7].style.height = "10%";})}, +{origCount:1127, fun:(function anonymous() {allElements[0].style.display = "-moz-inline-box";})}, +{origCount:1128, fun:(function anonymous() {allElements[3].style.clear = "right";})}, +{origCount:1129, fun:(function anonymous() {allElements[11].style.clear = "left";})}, +{origCount:1130, fun:(function anonymous() {allElements[1].style.color = "black";})}, +{origCount:1131, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:1132, fun:(function anonymous() {allElements[4].style.width = "10%";})}, +{origCount:1133, fun:(function anonymous() {allElements[2].style.display = "-moz-grid";})}, +{origCount:1134, fun:(function anonymous() {allElements[4].style.height = "100px";})}, +{origCount:1135, fun:(function anonymous() {allElements[4].style.clear = "both";})}, +{origCount:1136, fun:(function anonymous() {allElements[6].style.position = "static";})}, +{origCount:1137, fun:(function anonymous() {allElements[2].style['float'] = "left";})}, +{origCount:1138, fun:(function anonymous() {allElements[0].style.overflow = "scroll";})}, +{origCount:1139, fun:(function anonymous() {allElements[3].style.display = "table-cell";})}, +{origCount:1140, fun:(function anonymous() {allElements[4].style.color = "blue";})}, +{origCount:1141, fun:(function anonymous() {allElements[9].style.clear = "left";})}, +{origCount:1142, fun:(function anonymous() {allElements[9].style.clear = "none";})}, +{origCount:1143, fun:(function anonymous() {allElements[11].style['float'] = "left";})}, +{origCount:1144, fun:(function anonymous() {allElements[7].style.display = "-moz-inline-block";})}, +{origCount:1145, fun:(function anonymous() {allElements[3].style.clear = "none";})}, +{origCount:1146, fun:(function anonymous() {allElements[2].style.visibility = "collapse";})}, +{origCount:1147, fun:(function anonymous() {allElements[12].style['float'] = "none";})}, +{origCount:1148, fun:(function anonymous() {allElements[12].style.background = "transparent";})}, +{origCount:1149, fun:(function anonymous() {allElements[6].style.width = "1px";})}, +{origCount:1150, fun:(function anonymous() {allElements[1].style.width = "10%";})}, +{origCount:1151, fun:(function anonymous() {allElements[1].style['float'] = "none";})}, +{origCount:1152, fun:(function anonymous() {allElements[0].style.width = "1px";})}, +{origCount:1153, fun:(function anonymous() {allElements[2].style.width = "20em";})}, +{origCount:1154, fun:(function anonymous() {allElements[0].style.display = "-moz-popup";})}, +{origCount:1155, fun:(function anonymous() {allElements[0].style.color = "red";})}, +{origCount:1156, fun:(function anonymous() {allElements[6].style.visibility = "visible";})}, +{origCount:1157, fun:(function anonymous() {allElements[12].style.background = "#fcd";})}, +{origCount:1158, fun:(function anonymous() {allElements[9].style.visibility = "hidden";})}, +{origCount:1159, fun:(function anonymous() {allElements[4].style.overflow = "scroll";})}, +{origCount:1160, fun:(function anonymous() {allElements[1].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1161, fun:(function anonymous() {allElements[6].style.display = "block";})}, +{origCount:1162, fun:(function anonymous() {allElements[11].style.background = "#fcd";})}, +{origCount:1163, fun:(function anonymous() {allElements[9].style.visibility = "collapse";})}, +{origCount:1164, fun:(function anonymous() {allElements[5].style.background = "#fcd";})}, +{origCount:1165, fun:(function anonymous() {allElements[4].style.clear = "left";})}, +{origCount:1166, fun:(function anonymous() {allElements[0].style['float'] = "right";})}, +{origCount:1167, fun:(function anonymous() {allElements[10].style.width = "200%";})}, +{origCount:1168, fun:(function anonymous() {allElements[1].style['float'] = "left";})}, +{origCount:1169, fun:(function anonymous() {allElements[4].style.height = "auto";})}, +{origCount:1170, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:1171, fun:(function anonymous() {allElements[4].style.color = "blue";})}, +{origCount:1172, fun:(function anonymous() {allElements[11].style.visibility = "visible";})}, +{origCount:1173, fun:(function anonymous() {allElements[1].style.position = "absolute";})}, +{origCount:1174, fun:(function anonymous() {allElements[3].style.visibility = "visible";})}, +{origCount:1175, fun:(function anonymous() {allElements[12].style.position = "fixed";})}, +{origCount:1176, fun:(function anonymous() {allElements[5].style.display = "table-column-group";})}, +{origCount:1177, fun:(function anonymous() {allElements[2].style.clear = "right";})}, +{origCount:1178, fun:(function anonymous() {allElements[9].style.overflow = "hidden";})}, +{origCount:1179, fun:(function anonymous() {allElements[3].style.width = "20em";})}, +{origCount:1180, fun:(function anonymous() {allElements[4].style.position = "relative";})}, +{origCount:1181, fun:(function anonymous() {allElements[5].style.width = "20em";})}, +{origCount:1182, fun:(function anonymous() {allElements[10].style.visibility = "visible";})}, +{origCount:1183, fun:(function anonymous() {allElements[0].style.overflow = "scroll";})}, +{origCount:1184, fun:(function anonymous() {allElements[5].style.color = "red";})}, +{origCount:1185, fun:(function anonymous() {allElements[4].style.clear = "right";})}, +{origCount:1186, fun:(function anonymous() {allElements[5].style.overflow = "hidden";})}, +{origCount:1187, fun:(function anonymous() {allElements[10].style.clear = "none";})}, +{origCount:1188, fun:(function anonymous() {allElements[1].style.position = "fixed";})}, +{origCount:1189, fun:(function anonymous() {allElements[9].style.width = "1px";})}, +{origCount:1190, fun:(function anonymous() {allElements[0].style.color = "blue";})}, +{origCount:1191, fun:(function anonymous() {allElements[5].style.position = "static";})}, +{origCount:1192, fun:(function anonymous() {allElements[4].style.overflow = "hidden";})}, +{origCount:1193, fun:(function anonymous() {allElements[2].style.position = "relative";})}, +{origCount:1194, fun:(function anonymous() {allElements[4].style.position = "absolute";})}, +{origCount:1195, fun:(function anonymous() {allElements[4].style['float'] = "none";})}, +{origCount:1196, fun:(function anonymous() {allElements[7].style.color = "black";})}, +{origCount:1197, fun:(function anonymous() {allElements[4].style.color = "blue";})}, +{origCount:1198, fun:(function anonymous() {allElements[1].style.position = "absolute";})}, +{origCount:1199, fun:(function anonymous() {allElements[5].style.overflow = "scroll";})}, +{origCount:1200, fun:(function anonymous() {allElements[6].style.visibility = "visible";})}, +{origCount:1201, fun:(function anonymous() {allElements[11].style.clear = "right";})}, +{origCount:1202, fun:(function anonymous() {allElements[12].style.position = "static";})}, +{origCount:1203, fun:(function anonymous() {allElements[2].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1204, fun:(function anonymous() {allElements[11].style.visibility = "hidden";})}, +{origCount:1205, fun:(function anonymous() {allElements[7].style.color = "red";})}, +{origCount:1206, fun:(function anonymous() {allElements[7].style.clear = "right";})}, +{origCount:1207, fun:(function anonymous() {allElements[4].style.clear = "none";})}, +{origCount:1208, fun:(function anonymous() {allElements[4].style.display = "list-item";})}, +{origCount:1209, fun:(function anonymous() {allElements[12].style.background = "transparent";})}, +{origCount:1210, fun:(function anonymous() {allElements[7].style['float'] = "left";})}, +{origCount:1211, fun:(function anonymous() {allElements[8].style.color = "red";})}, +{origCount:1212, fun:(function anonymous() {allElements[7].style.width = "20em";})}, +{origCount:1213, fun:(function anonymous() {allElements[9].style.clear = "right";})}, +{origCount:1214, fun:(function anonymous() {allElements[8].style.height = "100px";})}, +{origCount:1215, fun:(function anonymous() {allElements[8].style.color = "red";})}, +{origCount:1216, fun:(function anonymous() {allElements[2].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1217, fun:(function anonymous() {allElements[8].style.overflow = "auto";})}, +{origCount:1218, fun:(function anonymous() {allElements[5].style.position = "relative";})}, +{origCount:1219, fun:(function anonymous() {allElements[0].style['float'] = "left";})}, +{origCount:1220, fun:(function anonymous() {allElements[10].style.overflow = "visible";})}, +{origCount:1221, fun:(function anonymous() {allElements[3].style.overflow = "visible";})}, +{origCount:1222, fun:(function anonymous() {allElements[8].style.visibility = "hidden";})}, +{origCount:1223, fun:(function anonymous() {allElements[6].style.visibility = "hidden";})}, +{origCount:1224, fun:(function anonymous() {allElements[3].style['float'] = "right";})}, +{origCount:1225, fun:(function anonymous() {allElements[3].style.width = "1px";})}, +{origCount:1226, fun:(function anonymous() {allElements[12].style['float'] = "left";})}, +{origCount:1227, fun:(function anonymous() {allElements[9].style.display = "list-item";})}, +{origCount:1228, fun:(function anonymous() {allElements[1].style.width = "20em";})}, +{origCount:1229, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:1230, fun:(function anonymous() {allElements[12].style.overflow = "auto";})}, +{origCount:1231, fun:(function anonymous() {allElements[5].style.overflow = "hidden";})}, +{origCount:1232, fun:(function anonymous() {allElements[12].style.overflow = "auto";})}, +{origCount:1233, fun:(function anonymous() {allElements[2].style.height = "2em";})}, +{origCount:1234, fun:(function anonymous() {allElements[5].style.display = "table-cell";})}, +{origCount:1235, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:1236, fun:(function anonymous() {allElements[8].style.height = "200%";})}, +{origCount:1237, fun:(function anonymous() {allElements[5].style.clear = "both";})}, +{origCount:1238, fun:(function anonymous() {allElements[12].style.height = "auto";})}, +{origCount:1239, fun:(function anonymous() {allElements[7].style.overflow = "auto";})}, +{origCount:1240, fun:(function anonymous() {allElements[8].style.overflow = "auto";})}, +{origCount:1241, fun:(function anonymous() {allElements[9].style.visibility = "visible";})}, +{origCount:1242, fun:(function anonymous() {allElements[2].style.display = "-moz-deck";})}, +{origCount:1243, fun:(function anonymous() {allElements[5].style.color = "black";})}, +{origCount:1244, fun:(function anonymous() {allElements[10].style.clear = "none";})}, +{origCount:1245, fun:(function anonymous() {allElements[10].style['float'] = "right";})}, +{origCount:1246, fun:(function anonymous() {allElements[11].style.width = "20em";})}, +{origCount:1247, fun:(function anonymous() {allElements[4].style.background = "#fcd";})}, +{origCount:1248, fun:(function anonymous() {allElements[8].style.position = "fixed";})}, +{origCount:1249, fun:(function anonymous() {allElements[3].style.clear = "both";})}, +{origCount:1250, fun:(function anonymous() {allElements[7].style.visibility = "collapse";})}, +{origCount:1251, fun:(function anonymous() {allElements[0].style.overflow = "visible";})}, +{origCount:1252, fun:(function anonymous() {allElements[12].style.height = "100px";})}, +{origCount:1253, fun:(function anonymous() {allElements[10].style.clear = "right";})}, +{origCount:1254, fun:(function anonymous() {allElements[0].style.overflow = "hidden";})}, +{origCount:1255, fun:(function anonymous() {allElements[1].style.overflow = "hidden";})}, +{origCount:1256, fun:(function anonymous() {allElements[3].style.position = "static";})}, +{origCount:1257, fun:(function anonymous() {allElements[1].style.width = "10%";})}, +{origCount:1258, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:1259, fun:(function anonymous() {allElements[3].style.overflow = "auto";})}, +{origCount:1260, fun:(function anonymous() {allElements[4].style.color = "green";})}, +{origCount:1261, fun:(function anonymous() {allElements[10].style.width = "auto";})}, +{origCount:1262, fun:(function anonymous() {allElements[11].style.overflow = "hidden";})}, +{origCount:1263, fun:(function anonymous() {allElements[1].style.clear = "none";})}, +{origCount:1264, fun:(function anonymous() {allElements[11].style['float'] = "right";})}, +{origCount:1265, fun:(function anonymous() {allElements[7].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1266, fun:(function anonymous() {allElements[7].style.overflow = "visible";})}, +{origCount:1267, fun:(function anonymous() {allElements[5].style['float'] = "left";})}, +{origCount:1268, fun:(function anonymous() {allElements[5].style.position = "fixed";})}, +{origCount:1269, fun:(function anonymous() {allElements[0].style.visibility = "hidden";})}, +{origCount:1270, fun:(function anonymous() {allElements[9].style.height = "100px";})}, +{origCount:1271, fun:(function anonymous() {allElements[10].style.height = "200%";})}, +{origCount:1272, fun:(function anonymous() {allElements[9].style.position = "absolute";})}, +{origCount:1273, fun:(function anonymous() {allElements[12].style.clear = "both";})}, +{origCount:1274, fun:(function anonymous() {allElements[11].style.visibility = "visible";})}, +{origCount:1275, fun:(function anonymous() {allElements[11].style.position = "fixed";})}, +{origCount:1276, fun:(function anonymous() {allElements[6].style.width = "20em";})}, +{origCount:1277, fun:(function anonymous() {allElements[12].style.height = "200%";})}, +{origCount:1278, fun:(function anonymous() {allElements[10].style.display = "list-item";})}, +{origCount:1279, fun:(function anonymous() {allElements[5].style.clear = "left";})}, +{origCount:1280, fun:(function anonymous() {allElements[3].style.clear = "left";})}, +{origCount:1281, fun:(function anonymous() {allElements[8].style.position = "fixed";})}, +{origCount:1282, fun:(function anonymous() {allElements[1].style.overflow = "auto";})}, +{origCount:1283, fun:(function anonymous() {allElements[0].style.height = "10%";})}, +{origCount:1284, fun:(function anonymous() {allElements[10].style['float'] = "right";})}, +{origCount:1285, fun:(function anonymous() {allElements[10].style.clear = "both";})}, +{origCount:1286, fun:(function anonymous() {allElements[7].style.background = "transparent";})}, +{origCount:1287, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:1288, fun:(function anonymous() {allElements[9].style.display = "-moz-box";})}, +{origCount:1289, fun:(function anonymous() {allElements[0].style.width = "auto";})}, +{origCount:1290, fun:(function anonymous() {allElements[8].style.color = "black";})}, +{origCount:1291, fun:(function anonymous() {allElements[1].style['float'] = "right";})}, +{origCount:1292, fun:(function anonymous() {allElements[9].style.position = "relative";})}, +{origCount:1293, fun:(function anonymous() {allElements[12].style.clear = "none";})}, +{origCount:1294, fun:(function anonymous() {allElements[3].style.width = "1px";})}, +{origCount:1295, fun:(function anonymous() {allElements[12].style.color = "red";})}, +{origCount:1296, fun:(function anonymous() {allElements[6].style.display = "-moz-inline-block";})}, +{origCount:1297, fun:(function anonymous() {allElements[4].style.width = "10%";})}, +{origCount:1298, fun:(function anonymous() {allElements[11].style.height = "2em";})}, +{origCount:1299, fun:(function anonymous() {allElements[6].style.height = "2em";})}, +{origCount:1300, fun:(function anonymous() {allElements[8].style.visibility = "collapse";})}, +{origCount:1301, fun:(function anonymous() {allElements[9].style.position = "absolute";})}, +{origCount:1302, fun:(function anonymous() {allElements[2].style.color = "green";})}, +{origCount:1303, fun:(function anonymous() {allElements[5].style.overflow = "auto";})}, +{origCount:1304, fun:(function anonymous() {allElements[11].style.visibility = "collapse";})}, +{origCount:1305, fun:(function anonymous() {allElements[12].style.color = "black";})}, +{origCount:1306, fun:(function anonymous() {allElements[12].style.background = "transparent";})}, +{origCount:1307, fun:(function anonymous() {allElements[6].style['float'] = "left";})}, +{origCount:1308, fun:(function anonymous() {allElements[11].style['float'] = "right";})}, +{origCount:1309, fun:(function anonymous() {allElements[6].style.clear = "none";})}, +{origCount:1310, fun:(function anonymous() {allElements[10].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1311, fun:(function anonymous() {allElements[3].style.display = "-moz-grid-group";})}, +{origCount:1312, fun:(function anonymous() {allElements[3].style['float'] = "right";})}, +{origCount:1313, fun:(function anonymous() {allElements[2].style.color = "blue";})}, +{origCount:1314, fun:(function anonymous() {allElements[5].style.visibility = "hidden";})}, +{origCount:1315, fun:(function anonymous() {allElements[6].style.background = "transparent";})}, +{origCount:1316, fun:(function anonymous() {allElements[9].style['float'] = "right";})}, +{origCount:1317, fun:(function anonymous() {allElements[7].style.background = "#fcd";})}, +{origCount:1318, fun:(function anonymous() {allElements[5].style.visibility = "collapse";})}, +{origCount:1319, fun:(function anonymous() {allElements[9].style.clear = "both";})}, +{origCount:1320, fun:(function anonymous() {allElements[11].style.color = "green";})}, +{origCount:1321, fun:(function anonymous() {allElements[4].style.clear = "none";})}, +{origCount:1322, fun:(function anonymous() {allElements[6].style.display = "-moz-deck";})}, +{origCount:1323, fun:(function anonymous() {allElements[9].style.clear = "none";})}, +{origCount:1324, fun:(function anonymous() {allElements[6].style.position = "static";})}, +{origCount:1325, fun:(function anonymous() {allElements[2].style.overflow = "scroll";})}, +{origCount:1326, fun:(function anonymous() {allElements[3].style.background = "transparent";})}, +{origCount:1327, fun:(function anonymous() {allElements[1].style.overflow = "auto";})}, +{origCount:1328, fun:(function anonymous() {allElements[2].style.visibility = "hidden";})}, +{origCount:1329, fun:(function anonymous() {allElements[10].style.overflow = "hidden";})}, +{origCount:1330, fun:(function anonymous() {allElements[6].style.overflow = "visible";})}, +{origCount:1331, fun:(function anonymous() {allElements[8].style.width = "auto";})}, +{origCount:1332, fun:(function anonymous() {allElements[7].style.width = "200%";})}, +{origCount:1333, fun:(function anonymous() {allElements[11].style.width = "200%";})}, +{origCount:1334, fun:(function anonymous() {allElements[10].style.visibility = "collapse";})}, +{origCount:1335, fun:(function anonymous() {allElements[11].style.background = "transparent";})}, +{origCount:1336, fun:(function anonymous() {allElements[5].style.overflow = "visible";})}, +{origCount:1337, fun:(function anonymous() {allElements[12].style['float'] = "right";})}, +{origCount:1338, fun:(function anonymous() {allElements[10].style.background = "#fcd";})}, +{origCount:1339, fun:(function anonymous() {allElements[6].style['float'] = "right";})}, +{origCount:1340, fun:(function anonymous() {allElements[4].style.visibility = "visible";})}, +{origCount:1341, fun:(function anonymous() {allElements[10].style.height = "auto";})}, +{origCount:1342, fun:(function anonymous() {allElements[3].style.position = "static";})}, +{origCount:1343, fun:(function anonymous() {allElements[2].style.display = "-moz-box";})}, +{origCount:1344, fun:(function anonymous() {allElements[12].style.color = "red";})}, +{origCount:1345, fun:(function anonymous() {allElements[0].style.clear = "none";})}, +{origCount:1346, fun:(function anonymous() {allElements[10].style.clear = "left";})}, +{origCount:1347, fun:(function anonymous() {allElements[8].style['float'] = "none";})}, +{origCount:1348, fun:(function anonymous() {allElements[0].style.visibility = "collapse";})}, +{origCount:1349, fun:(function anonymous() {allElements[4].style.visibility = "hidden";})}, +{origCount:1350, fun:(function anonymous() {allElements[0].style.position = "absolute";})}, +{origCount:1351, fun:(function anonymous() {allElements[6].style.display = "-moz-grid-group";})}, +{origCount:1352, fun:(function anonymous() {allElements[1].style.height = "100px";})}, +{origCount:1353, fun:(function anonymous() {allElements[5].style['float'] = "none";})}, +{origCount:1354, fun:(function anonymous() {allElements[9].style['float'] = "none";})}, +{origCount:1355, fun:(function anonymous() {allElements[5].style.display = "table-footer-group";})}, +{origCount:1356, fun:(function anonymous() {allElements[0].style.clear = "both";})}, +{origCount:1357, fun:(function anonymous() {allElements[11].style.clear = "none";})}, +{origCount:1358, fun:(function anonymous() {allElements[5].style.color = "green";})}, +{origCount:1359, fun:(function anonymous() {allElements[1].style['float'] = "left";})}, +{origCount:1360, fun:(function anonymous() {allElements[3].style.background = "#fcd";})}, +{origCount:1361, fun:(function anonymous() {allElements[5].style.display = "block";})}, +{origCount:1362, fun:(function anonymous() {allElements[11].style.width = "1px";})}, +{origCount:1363, fun:(function anonymous() {allElements[2].style['float'] = "right";})}, +{origCount:1364, fun:(function anonymous() {allElements[8].style.display = "table-column";})}, +{origCount:1365, fun:(function anonymous() {allElements[9].style.width = "20em";})}, +{origCount:1366, fun:(function anonymous() {allElements[10].style.visibility = "visible";})}, +{origCount:1367, fun:(function anonymous() {allElements[4].style['float'] = "none";})}, +{origCount:1368, fun:(function anonymous() {allElements[9].style.visibility = "hidden";})}, +{origCount:1369, fun:(function anonymous() {allElements[5].style.width = "200%";})}, +{origCount:1370, fun:(function anonymous() {allElements[9].style.background = "transparent";})}, +{origCount:1371, fun:(function anonymous() {allElements[2].style.color = "red";})}, +{origCount:1372, fun:(function anonymous() {allElements[2].style.width = "auto";})}, +{origCount:1373, fun:(function anonymous() {allElements[1].style.background = "#fcd";})}, +{origCount:1374, fun:(function anonymous() {allElements[5].style.width = "10%";})}, +{origCount:1375, fun:(function anonymous() {allElements[6].style.overflow = "visible";})}, +{origCount:1376, fun:(function anonymous() {allElements[10].style.display = "-moz-inline-block";})}, +{origCount:1377, fun:(function anonymous() {allElements[8].style.visibility = "collapse";})}, +{origCount:1378, fun:(function anonymous() {allElements[7].style.display = "inline";})}, +{origCount:1379, fun:(function anonymous() {allElements[11].style.position = "fixed";})}, +{origCount:1380, fun:(function anonymous() {allElements[1].style.display = "-moz-stack";})}, +{origCount:1381, fun:(function anonymous() {allElements[7].style.clear = "left";})}, +{origCount:1382, fun:(function anonymous() {allElements[9].style.overflow = "auto";})}, +{origCount:1383, fun:(function anonymous() {allElements[0].style.height = "10%";})}, +{origCount:1384, fun:(function anonymous() {allElements[10].style.overflow = "scroll";})}, +{origCount:1385, fun:(function anonymous() {allElements[7].style.height = "100px";})}, +{origCount:1386, fun:(function anonymous() {allElements[8].style.overflow = "auto";})}, +{origCount:1387, fun:(function anonymous() {allElements[6].style.background = "#fcd";})}, +{origCount:1388, fun:(function anonymous() {allElements[7].style.width = "auto";})}, +{origCount:1389, fun:(function anonymous() {allElements[3].style.position = "relative";})}, +{origCount:1390, fun:(function anonymous() {allElements[12].style.width = "10%";})}, +{origCount:1391, fun:(function anonymous() {allElements[1].style.position = "absolute";})}, +{origCount:1392, fun:(function anonymous() {allElements[1].style.background = "url(http://www.google.com/images/logo_sm.gif)";})}, +{origCount:1393, fun:(function anonymous() {allElements[5].style.clear = "left";})}, +{origCount:1394, fun:(function anonymous() {allElements[4].style['float'] = "left";})}, +{origCount:1395, fun:(function anonymous() {allElements[6].style.width = "20em";})}, +{origCount:1396, fun:(function anonymous() {allElements[0].style.height = "200%";})}, +{origCount:1397, fun:(function anonymous() {allElements[8].style.width = "200%";})}, +{origCount:1398, fun:(function anonymous() {allElements[6].style.height = "auto";})}, +{origCount:1399, fun:(function anonymous() {allElements[2].style.overflow = "scroll";})}, +{origCount:1400, fun:(function anonymous() {allElements[1].style.clear = "left";})}, +{origCount:1401, fun:(function anonymous() {allElements[7].style.display = "-moz-box";})}, +{origCount:1402, fun:(function anonymous() {allElements[0].style['float'] = "none";})}, +{origCount:1403, fun:(function anonymous() {allElements[0].style.clear = "none";})}, +{origCount:1404, fun:(function anonymous() {allElements[10].style.height = "100px";})}, +{origCount:1405, fun:(function anonymous() {allElements[11].style.width = "20em";})}, +{origCount:1406, fun:(function anonymous() {allElements[9].style.clear = "both";})}, +{origCount:1407, fun:(function anonymous() {allElements[7].style.position = "static";})}, +{origCount:1408, fun:(function anonymous() {allElements[12].style['float'] = "none";})}, +{origCount:1409, fun:(function anonymous() {allElements[4].style.position = "static";})}, +{origCount:1410, fun:(function anonymous() {allElements[0].style.height = "200%";})}, +{origCount:1411, fun:(function anonymous() {allElements[7].style['float'] = "none";})}, +{origCount:1412, fun:(function anonymous() {allElements[3].style.clear = "none";})}, +{origCount:1413, fun:(function anonymous() {allElements[6].style.color = "green";})}, +{origCount:1414, fun:(function anonymous() {allElements[10].style.height = "200%";})}, +{origCount:1415, fun:(function anonymous() {allElements[7].style.overflow = "visible";})} + + ]; + + +var output = eval(commands.toSource().replace(/anonymous/g,"")).toSource().replace( /\)\},/g , ")},\n"); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-311583.js b/js/src/tests/js1_5/extensions/regress-311583.js new file mode 100644 index 000000000..512427cc1 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-311583.js @@ -0,0 +1,21 @@ +/* -*- 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 = 311583; +var summary = 'uneval(array) should use elision for holes'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var a = new Array(3); +a[0] = a[2] = 0; + +actual = uneval(a); +expect = '[0, , 0]'; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-311792-01.js b/js/src/tests/js1_5/extensions/regress-311792-01.js new file mode 100644 index 000000000..0df7dd3b2 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-311792-01.js @@ -0,0 +1,26 @@ +/* -*- 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 = 311792; +var summary = 'Root Array.prototype methods'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function index_getter() +{ + gc(); + return 100; +} + +var a = [0, 1]; +a.__defineGetter__(0, index_getter); + +uneval(a.slice(0, 1)); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-311792-02.js b/js/src/tests/js1_5/extensions/regress-311792-02.js new file mode 100644 index 000000000..3b0141559 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-311792-02.js @@ -0,0 +1,40 @@ +/* -*- 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 = 311792; +var summary = 'Root Array.prototype methods'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var subverted = 0; + +function index_getter() +{ + delete a[0]; + gc(); + for (var i = 0; i != 1 << 14; ++i) { + var tmp = new String("test"); + tmp = null; + } + return 1; +} + +function index_setter(value) +{ + subverted = value; +} + +var a = [ Math.sqrt(2), 0 ]; +a.__defineGetter__(1, index_getter); +a.__defineSetter__(1, index_setter); + +a.reverse(); +printStatus(subverted) + + reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-313763.js b/js/src/tests/js1_5/extensions/regress-313763.js new file mode 100644 index 000000000..c5ecfb2d8 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-313763.js @@ -0,0 +1,46 @@ +/* -*- 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 = 313763; +var summary = 'Root jsarray.c creatures'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); +printStatus ('This bug requires TOO_MUCH_GC'); + +var N = 0x80000002; +var array = Array(N); +array[N - 1] = 1; +array[N - 2] = 2; + +// Set getter not to wait until engine loops through 2^31 holes in the array. +var LOOP_TERMINATOR = "stop_long_loop"; +array.__defineGetter__(N - 2, function() { + throw "stop_long_loop"; + }); + +var prepared_string = String(1); +array.__defineGetter__(N - 1, function() { + var tmp = prepared_string; + prepared_string = null; + return tmp; + }) + + + try { + array.unshift(1); + } catch (e) { + if (e !== LOOP_TERMINATOR) + throw e; + } + +var expect = "1"; +var actual = array[N]; +printStatus(expect === actual); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-313803.js b/js/src/tests/js1_5/extensions/regress-313803.js new file mode 100644 index 000000000..27aafd144 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-313803.js @@ -0,0 +1,24 @@ +/* -*- 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 = 313803; +var summary = 'uneval() on func with embedded objects with getter or setter'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var func = function ff() { + obj = { get foo() { return "foo"; }}; + return 1; +}; + +actual = uneval(func); + +expect = '(function ff() {obj = {get foo () {return "foo";}};return 1;})'; + +compareSource(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-313938.js b/js/src/tests/js1_5/extensions/regress-313938.js new file mode 100644 index 000000000..e4fec8032 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-313938.js @@ -0,0 +1,54 @@ +/* -*- 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 = 313938; +var summary = 'Root access in jsscript.c'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); + reportCompare("Script not defined, Test skipped.", + "Script not defined, Test skipped.", + summary); +} +else +{ + var str = " 2;".substring(1); + "1".substring(2); + expect = Script.prototype.compile(str).toSource(); + + var likeString = { + toString: function() { + var tmp = str; + str = null; + return tmp; + } + }; + + TWO = 2.0; + + var likeObject = { + valueOf: function() { + if (typeof gc == "function") + gc(); + for (var i = 0; i != 40000; ++i) { + var tmp = 1e100 * TWO; + } + return this; + } + } + + var s = Script.prototype.compile(likeString, likeObject); + var actual = s.toSource(); + printStatus(expect === actual); + + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_5/extensions/regress-314874.js b/js/src/tests/js1_5/extensions/regress-314874.js new file mode 100644 index 000000000..d0329d8a5 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-314874.js @@ -0,0 +1,40 @@ +/* -*- 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 = 314874; +var summary = 'Function.call/apply with non-primitive argument'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var thisArg = { valueOf: function() { return {a: 'a', b: 'b'}; } }; + + var f = function () { return (this); }; + + expect = f.call(thisArg); + + thisArg.f = f; + + actual = thisArg.f(); + + delete thisArg.f; + + expect = expect.toSource(); + actual = actual.toSource(); + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-315509-02.js b/js/src/tests/js1_5/extensions/regress-315509-02.js new file mode 100644 index 000000000..40e64b7ea --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-315509-02.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 = 315509; +var summary = 'Array.prototype.unshift do not crash on Arrays with holes'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function x1() { + var a = new Array(1); + a.unshift(1); +} +function x2() { + var a = new Array(1); + a.unshift.call(a, 1); +} +function x3() { + var a = new Array(1); + a.x = a.unshift; + a.x(1); +} +function x4() { + var a = new Array(1); + a.__defineSetter__("x", a.unshift); + a.x = 1; +} + +for (var i = 0; i < 10; i++) +{ + x1(); + x2(); + x3(); + x4(); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-319683.js b/js/src/tests/js1_5/extensions/regress-319683.js new file mode 100644 index 000000000..47e0e8042 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-319683.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 = 319683; +var summary = 'Do not crash in call_enumerate'; +var actual = 'No Crash'; +var expect = 'No Crash'; +printBugNumber(BUGNUMBER); +printStatus (summary); + +function crash(){ + function f(){ + var x; + function g(){ + x=1; //reference anything here or will not crash. + } + } + + //apply an object to the __proto__ attribute + f.__proto__={}; + + //the following call will cause crash + f(); +} + +crash(); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-322957.js b/js/src/tests/js1_5/extensions/regress-322957.js new file mode 100644 index 000000000..0ae58b84e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-322957.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 = 322957; +var summary = 'TryMethod should not eat getter exceptions'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var obj = { get toSource() { throw "EXCEPTION"; } }; + +var got_proper_exception = -1; + +try { + uneval(obj); +} catch (e) { + got_proper_exception = (e === "EXCEPTION"); +} + +expect = true; +actual = got_proper_exception; +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-327608.js b/js/src/tests/js1_5/extensions/regress-327608.js new file mode 100644 index 000000000..57f1b09b2 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-327608.js @@ -0,0 +1,48 @@ +/* -*- 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 = 327608; +var summary = 'Do not assume we will find the prototype property'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); +print('This test runs only in the browser'); + +function countProps(obj) +{ + var c; + for (var prop in obj) + ++c; + return c; +} + +function init() +{ + var inp = document.getElementsByTagName("input")[0]; + countProps(inp); + gc(); + var blurfun = inp.blur; + blurfun.__proto__ = null; + countProps(blurfun); + reportCompare(expect, actual, summary); + gDelayTestDriverEnd = false; + jsTestDriverEnd(); +} + +if (typeof window != 'undefined') +{ + // delay test driver end + gDelayTestDriverEnd = true; + + document.write('<input>'); + window.addEventListener("load", init, false); +} +else +{ + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_5/extensions/regress-328443.js b/js/src/tests/js1_5/extensions/regress-328443.js new file mode 100644 index 000000000..897ee8fc1 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-328443.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 = 328443; +var summary = 'Uncatchable exception with |new (G.call) (F);| when F proto is null'; +var actual = ''; +var expect = 'Exception caught'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var F = (function(){}); +F.__proto__ = null; + +var G = (function(){}); + +var z; + +z = "uncatchable exception!!!"; +try { + new (G.call) (F); + + actual = "No exception"; +} catch (er) { + actual = "Exception caught"; + printStatus("Exception was caught: " + er); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-328556.js b/js/src/tests/js1_5/extensions/regress-328556.js new file mode 100644 index 000000000..7a5b21041 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-328556.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 = 328556; +var summary = 'Do not Assert: growth == (size_t)-1 || (nchars + 1) * sizeof(char16_t) == growth, in jsarray.c'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var D = []; +D.foo = D; +uneval(D); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-330569.js b/js/src/tests/js1_5/extensions/regress-330569.js new file mode 100644 index 000000000..986429fae --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-330569.js @@ -0,0 +1,94 @@ +// |reftest| skip -- Yarr doesn't bail on complex regexps. +/* -*- 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 = 330569; +var summary = 'RegExp - throw InternalError on too complex regular expressions'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var s; + expect = 'InternalError: regular expression too complex'; + + s = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' + + '<html>\n' + + '<head>\n' + + '<meta http-equiv="content-type" content="text/html; charset=windows-1250">\n' + + '<meta name="generator" content="PSPad editor, www.pspad.com">\n' + + '<title></title>\n'+ + '</head>\n' + + '<body>\n' + + '<!-- hello -->\n' + + '<script language="JavaScript">\n' + + 'var s = document. body. innerHTML;\n' + + 'var d = s. replace (/<!--(.*|\n)*-->/, "");\n' + + 'alert (d);\n' + + '</script>\n' + + '</body>\n' + + '</html>\n'; + + try + { + /<!--(.*|\n)*-->/.exec(s); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary + ': /<!--(.*|\\n)*-->/.exec(s)'); + + function testre( re, n ) { + for ( var i= 0; i <= n; ++i ) { + re.test( Array( i+1 ).join() ); + } + } + + try + { + testre( /(?:,*)*x/, 22 ); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary + ': testre( /(?:,*)*x/, 22 )'); + + try + { + testre( /(?:,|,)*x/, 22 ); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary + ': testre( /(?:,|,)*x/, 22 )'); + + try + { + testre( /(?:,|,|,|,|,)*x/, 10 ); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': testre( /(?:,|,|,|,|,)*x/, 10 )'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-333541.js b/js/src/tests/js1_5/extensions/regress-333541.js new file mode 100644 index 000000000..cc868daf3 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-333541.js @@ -0,0 +1,57 @@ +/* -*- 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 = 333541; +var summary = '1..toSource()'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function a(){ + return 1..toSource(); +} + +try +{ + expect = 'function a() {\n return 1..toSource();\n}'; + actual = a.toString(); + compareSource(expect, actual, summary + ': 1'); +} +catch(ex) +{ + actual = ex + ''; + reportCompare(expect, actual, summary + ': 1'); +} + +try +{ + expect = 'function a() {return 1..toSource();}'; + actual = a.toSource(); + compareSource(expect, actual, summary + ': 2'); +} +catch(ex) +{ + actual = ex + ''; + reportCompare(expect, actual, summary + ': 2'); +} + +expect = a; +actual = a.valueOf(); +reportCompare(expect, actual, summary + ': 3'); + +try +{ + expect = 'function a() {\n return 1..toSource();\n}'; + actual = "" + a; + compareSource(expect, actual, summary + ': 4'); +} +catch(ex) +{ + actual = ex + ''; + reportCompare(expect, actual, summary + ': 4'); +} diff --git a/js/src/tests/js1_5/extensions/regress-336409-1.js b/js/src/tests/js1_5/extensions/regress-336409-1.js new file mode 100644 index 000000000..32dbb3633 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-336409-1.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!xulRuntime.shell||Android) slow -- no results reported. +/* -*- 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 = 336409; +var summary = 'Integer overflow in js_obj_toSource'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expectExitCode(0); +expectExitCode(5); + +function createString(n) +{ + var l = n*1024*1024; + var r = 'r'; + + while (r.length < l) + { + r = r + r; + } + return r; +} + +try +{ + var n = 64; + printStatus('Creating ' + n + 'MB string'); + var r = createString(n); + printStatus('Done. length = ' + r.length); + printStatus('Creating object'); + var o = {f1: r, f2: r, f3: r,f4: r,f5: r, f6: r, f7: r, f8: r,f9: r}; + printStatus('object.toSource()'); + var rr = o.toSource(); + printStatus('Done.'); +} +catch(ex) +{ + expect = 'InternalError: allocation size overflow'; + actual = ex + ''; + print(actual); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-336409-2.js b/js/src/tests/js1_5/extensions/regress-336409-2.js new file mode 100644 index 000000000..b979eb208 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-336409-2.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!xulRuntime.shell&&((Android||(isDebugBuild&&xulRuntime.OS=="Linux")||xulRuntime.XPCOMABI.match(/x86_64/)))) slow -- can fail silently due to out of memory, bug 615011 - timeouts on slow debug Linux +/* -*- 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 = 336409; +var summary = 'Integer overflow in js_obj_toSource'; +var actual = 'No Crash'; +var expect = /(No Crash|InternalError: allocation size overflow|out of memory)/; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expectExitCode(0); +expectExitCode(5); + +function createString(n) +{ + var l = n*1024*1024; + var r = 'r'; + + while (r.length < l) + { + r = r + r; + } + return r; +} + +try +{ + var n = 128; + printStatus('Creating ' + n + 'MB string'); + var r = createString(n); + printStatus('Done. length = ' + r.length); + printStatus('Creating object'); + var o = {f1: r, f2: r, f3: r,f4: r,f5: r, f6: r, f7: r, f8: r,f9: r}; + printStatus('object.toSource()'); + var rr = o.toSource(); + printStatus('Done.'); +} +catch(ex) +{ + actual = ex + ''; + print(actual); +} + +reportMatch(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-336410-1.js b/js/src/tests/js1_5/extensions/regress-336410-1.js new file mode 100644 index 000000000..5362d0d94 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-336410-1.js @@ -0,0 +1,50 @@ +// |reftest| skip-if(!xulRuntime.shell||Android) slow -- can fail silently due to out of memory +/* -*- 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 = 336410; +var summary = 'Integer overflow in array_toSource'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expectExitCode(0); +expectExitCode(5); + +function createString(n) +{ + var l = n*1024*1024; + var r = 'r'; + + while (r.length < l) + { + r = r + r; + } + return r; +} + +try +{ + var n = 64; + printStatus('Creating ' + n + 'M length string'); + var r = createString(n); + printStatus('Done. length = ' + r.length); + printStatus('Creating array'); + var o=[r, r, r, r, r, r, r, r, r]; + printStatus('object.toSource()'); + var rr = o.toSource(); + printStatus('Done.'); +} +catch(ex) +{ + expect = '\(InternalError: allocation size overflow|out of memory\)'; + actual = ex + ''; + print(actual); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-336410-2.js b/js/src/tests/js1_5/extensions/regress-336410-2.js new file mode 100644 index 000000000..4ce18b65a --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-336410-2.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(!xulRuntime.shell&&((isDebugBuild&&xulRuntime.OS=="Linux")||Android||xulRuntime.XPCOMABI.match(/x86_64/)||xulRuntime.OS=="WINNT")) slow -- can fail silently due to out of memory, bug 621348 - timeouts on slow debug Linux +/* -*- 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 = 336410; +var summary = 'Integer overflow in array_toSource'; +var actual = 'No Crash'; +var expect = /(No Crash|InternalError: allocation size overflow|out of memory)/; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expectExitCode(0); +expectExitCode(5); + +function createString(n) +{ + var l = n*1024*1024; + var r = 'r'; + + while (r.length < l) + { + r = r + r; + } + return r; +} + +try +{ + var n = 128; + printStatus('Creating ' + n + 'M length string'); + var r = createString(n); + printStatus('Done. length = ' + r.length); + printStatus('Creating array'); + var o=[r, r, r, r, r, r, r, r, r]; + printStatus('object.toSource()'); + var rr = o.toSource(); + printStatus('Done.'); +} +catch(ex) +{ + actual = ex + ''; + print(actual); +} + +reportMatch(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-338804-01.js b/js/src/tests/js1_5/extensions/regress-338804-01.js new file mode 100644 index 000000000..9fb3a4a89 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-338804-01.js @@ -0,0 +1,69 @@ +/* -*- 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 = 338804; +var summary = 'GC hazards in constructor functions'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); +printStatus ('Uses Intel Assembly'); + +// <script> +// SpiderMonkey Script() GC hazard exploit +// +// scale: magic number ;-) +// BonEcho/2.0a2: 3000 +// Firefox/1.5.0.4: 2000 +// +var rooter, scale = 3000; + +/* + if(typeof(setTimeout) != "undefined") { + setTimeout(exploit, 2000); + } else { + exploit(); + } +*/ + +function exploit() { + if (typeof Script == 'undefined') + { + print('Test skipped. Script not defined.'); + } + else + { + Script({ toString: fillHeap }); + Script({ toString: fillHeap }); + } +} + +function createPayload() { + var result = "\u9090", i; + for(i = 0; i < 9; i++) { + result += result; + } + /* mov eax, 0xdeadfeed; mov ebx, eax; mov ecx, eax; mov edx, eax; int3 */ + result += "\uEDB8\uADFE\u89DE\u89C3\u89C1\uCCC2"; + return result; +} + +function fillHeap() { + rooter = []; + var payload = createPayload(), block = "", s2 = scale * 2, i; + for(i = 0; i < scale; i++) { + rooter[i] = block = block + payload; + } + for(; i < s2; i++) { + rooter[i] = payload + i; + } + return ""; +} + +// </script> + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-338804-02.js b/js/src/tests/js1_5/extensions/regress-338804-02.js new file mode 100644 index 000000000..e1e2a77ee --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-338804-02.js @@ -0,0 +1,70 @@ +/* -*- 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 = 338804; +var summary = 'GC hazards in constructor functions'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); +printStatus ('Uses Intel Assembly'); + +// <script> +// SpiderMonkey Script() GC hazard exploit +// +// scale: magic number ;-) +// BonEcho/2.0a2: 3000 +// Firefox/1.5.0.4: 2000 +// +var rooter, scale = 2000; + +exploit(); +/* + if(typeof(setTimeout) != "undefined") { + setTimeout(exploit, 2000); + } else { + exploit(); + } +*/ + +function exploit() { + if (typeof Script == 'undefined') + { + print('Test skipped. Script not defined.'); + } + else + { + Script({ toString: fillHeap }); + Script({ toString: fillHeap }); + } +} + +function createPayload() { + var result = "\u9090", i; + for(i = 0; i < 9; i++) { + result += result; + } + /* mov eax, 0xdeadfeed; mov ebx, eax; mov ecx, eax; mov edx, eax; int3 */ + result += "\uEDB8\uADFE\u89DE\u89C3\u89C1\uCCC2"; + return result; +} + +function fillHeap() { + rooter = []; + var payload = createPayload(), block = "", s2 = scale * 2, i; + for(i = 0; i < scale; i++) { + rooter[i] = block = block + payload; + } + for(; i < s2; i++) { + rooter[i] = payload + i; + } + return ""; +} + +// </script> + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-338804-03.js b/js/src/tests/js1_5/extensions/regress-338804-03.js new file mode 100644 index 000000000..b3e759725 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-338804-03.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 = 338804; +var summary = 'GC hazards in constructor functions'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof Script != 'undefined') +{ + Script({ toString: fillHeap }); +} +RegExp({ toString: fillHeap }); + +function fillHeap() { + if (typeof gc == 'function') gc(); + var x = 1, tmp; + for (var i = 0; i != 50000; ++i) { + tmp = x / 3; + } +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-339685.js b/js/src/tests/js1_5/extensions/regress-339685.js new file mode 100644 index 000000000..295a08068 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-339685.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 = 339685; +var summary = 'Setting __proto__ null should not affect __iterator__'; +var actual = ''; +var expect = 'No Error'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var d = { a:2, b:3 }; + +d.__proto__ = null; + +try { + for (var p in d) + ; + actual = 'No Error'; +} catch(e) { + actual = e + ''; +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-341956-01.js b/js/src/tests/js1_5/extensions/regress-341956-01.js new file mode 100644 index 000000000..be5865384 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-341956-01.js @@ -0,0 +1,68 @@ +/* -*- 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 = 341956; +var summary = 'GC Hazards in jsarray.c - unshift'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var N = 0xFFFFFFFF; + + var a = []; + a[N - 1] = 1; + a.__defineGetter__(N - 1, function() { + var tmp = []; + tmp[N - 2] = 0; + if (typeof gc == 'function') + gc(); + for (var i = 0; i != 50000; ++i) { + var tmp = 1 / 3; + tmp /= 10; + } + for (var i = 0; i != 1000; ++i) { + // Make string with 11 characters that would take + // (11 + 1) * 2 bytes or sizeof(JSAtom) so eventually + // malloc will ovewrite just freed atoms. + var tmp2 = Array(12).join(' '); + } + return 10; + }); + + +// The following always-throw getter is to stop unshift from doing +// 2^32 iterations. + var toStop = "stringToStop"; + a[N - 3] = 0; + a.__defineGetter__(N - 3, function() { throw toStop; }); + + var good = false; + + try { + a.unshift(1); + } catch (e) { + if (e === toStop) + good = true; + } + + expect = true; + actual = good; + + reportCompare(expect, actual, summary); + + print('Done'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-341956-02.js b/js/src/tests/js1_5/extensions/regress-341956-02.js new file mode 100644 index 000000000..61fe4ff9d --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-341956-02.js @@ -0,0 +1,55 @@ +/* -*- 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 = 341956; +var summary = 'GC Hazards in jsarray.c - pop'; +var actual = ''; +var expect = 'GETTER RESULT'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var N = 0xFFFFFFFF; + var a = []; + a[N - 1] = 0; + + var expected = "GETTER RESULT"; + + a.__defineGetter__(N - 1, function() { + delete a[N - 1]; + var tmp = []; + tmp[N - 2] = 1; + + if (typeof gc == 'function') + gc(); + for (var i = 0; i != 50000; ++i) { + var tmp = 1 / 3; + tmp /= 10; + } + for (var i = 0; i != 1000; ++i) { + // Make string with 11 characters that would take + // (11 + 1) * 2 bytes or sizeof(JSAtom) so eventually + // malloc will ovewrite just freed atoms. + var tmp2 = Array(12).join(' '); + } + return expected; + }); + + actual = a.pop(); + + reportCompare(expect, actual, summary); + + print('Done'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-341956-03.js b/js/src/tests/js1_5/extensions/regress-341956-03.js new file mode 100644 index 000000000..b52f4148b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-341956-03.js @@ -0,0 +1,72 @@ +/* -*- 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 = 341956; +var summary = 'GC Hazards in jsarray.c - reverse'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var N = 0xFFFFFFFF; + var a = []; + a[N - 1] = 0; + + var expected = "GETTER RESULT"; + + a.__defineGetter__(N - 1, function() { + delete a[N - 1]; + var tmp = []; + tmp[N - 2] = 1; + + if (typeof gc == 'function') + gc(); + for (var i = 0; i != 50000; ++i) { + var tmp = 1 / 3; + tmp /= 10; + } + for (var i = 0; i != 1000; ++i) { + // Make string with 11 characters that would take + // (11 + 1) * 2 bytes or sizeof(JSAtom) so eventually + // malloc will ovewrite just freed atoms. + var tmp2 = Array(12).join(' '); + } + return expected; + }); + +// The following always-throw getter is to stop unshift from doing +// 2^32 iterations. + var toStop = "stringToStop"; + a[N - 3] = 0; + a.__defineGetter__(N - 3, function() { throw toStop; }); + + + var good = false; + + try { + a.reverse(); + } catch (e) { + if (e === toStop) + good = true; + } + + expect = true; + actual = good; + + reportCompare(expect, actual, summary); + + print('Done'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-342960.js b/js/src/tests/js1_5/extensions/regress-342960.js new file mode 100644 index 000000000..715427df7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-342960.js @@ -0,0 +1,46 @@ +// |reftest| skip-if(!xulRuntime.shell&&(Android||xulRuntime.OS=="WINNT"||xulRuntime.OS=="Linux")) silentfail slow -- bug 528464 +/* -*- 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 = 342960; +var summary = 'Do not crash on large string toSource'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expectExitCode(0); + expectExitCode(5); + + function v() + { + var meg=""; + var r=""; + var i; + print("don't interrupt the script. let it go."); + for(i=0;i<1024*1024;i++) meg += "v"; + for(i=0;i<1024/8;i++) r += meg; + var o={f1: r, f2: r, f3: r,f4: r,f5: r, f6: r, f7: r, f8: r,f9: r}; + print('done obj'); + var rr=r.toSource(); + print('done toSource()'); + } + + v(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-345967.js b/js/src/tests/js1_5/extensions/regress-345967.js new file mode 100644 index 000000000..58b72e3ad --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-345967.js @@ -0,0 +1,68 @@ +// |reftest| skip -- slow +/* -*- 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 = 345967; +var summary = 'Yet another unrooted atom in jsarray.c'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expectExitCode(0); + expectExitCode(3); + + print('This test will probably run out of memory'); + print('This test really should only fail on 64 bit machines'); + + var JSVAL_INT_MAX = (1 << 30) - 1; + + var a = new Array(JSVAL_INT_MAX + 2); + a[JSVAL_INT_MAX] = 0; + a[JSVAL_INT_MAX + 1] = 1; + + a.__defineGetter__(JSVAL_INT_MAX, function() { return 0; }); + + a.__defineSetter__(JSVAL_INT_MAX, function(value) { + delete a[JSVAL_INT_MAX + 1]; + var tmp = []; + tmp[JSVAL_INT_MAX + 2] = 2; + + if (typeof gc == 'function') + gc(); + for (var i = 0; i != 50000; ++i) { + var tmp = 1 / 3; + tmp /= 10; + } + for (var i = 0; i != 1000; ++i) { + // Make string with 11 characters that would take + // (11 + 1) * 2 bytes or sizeof(JSAtom) so eventually + // malloc will ovewrite just freed atoms. + var tmp2 = Array(12).join(' '); + } + }); + + + a.shift(); + + expect = 0; + actual = a[JSVAL_INT_MAX]; + if (expect !== actual) + print("BAD"); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-346494-01.js b/js/src/tests/js1_5/extensions/regress-346494-01.js new file mode 100644 index 000000000..755c3ddf4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-346494-01.js @@ -0,0 +1,90 @@ +/* -*- 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 = 346494; +var summary = 'various try...catch tests'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var pfx = "(function (x) {try {throw x}", + cg1 = " catch (e if e === 42) {var v = 'catch guard 1 ' + e; actual += v + ','; print(v);}" + cg2 = " catch (e if e === 43) {var v = 'catch guard 2 ' + e; actual += v + ','; print(v);}" + cat = " catch (e) {var v = 'catch all ' + e; actual += v + ','; print(v);}" + fin = " finally{var v = 'fin'; actual += v + ','; print(v)}", + end = "})"; + + var exphash = { + pfx: "(function (y) { var result = ''; y = y + ',';", + cg1: "result += (y === '42,') ? ('catch guard 1 ' + y):'';", + cg2: "result += (y === '43,') ? ('catch guard 2 ' + y):'';", + cat: "result += /catch guard/.test(result) ? '': ('catch all ' + y);", + fin: "result += 'fin,';", + end: "return result;})" + }; + + var src = [ + pfx + fin + end, + pfx + cat + end, + pfx + cat + fin + end, + pfx + cg1 + end, + pfx + cg1 + fin + end, + pfx + cg1 + cat + end, + pfx + cg1 + cat + fin + end, + pfx + cg1 + cg2 + end, + pfx + cg1 + cg2 + fin + end, + pfx + cg1 + cg2 + cat + end, + pfx + cg1 + cg2 + cat + fin + end, + ]; + + var expsrc = [ + exphash.pfx + exphash.fin + exphash.end, + exphash.pfx + exphash.cat + exphash.end, + exphash.pfx + exphash.cat + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1 + exphash.end, + exphash.pfx + exphash.cg1 + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1 + exphash.cat + exphash.end, + exphash.pfx + exphash.cg1 + exphash.cat + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.end, + exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.cat + exphash.end, + exphash.pfx + exphash.cg1 + exphash.cg2 + exphash.cat + exphash.fin + exphash.end, + ]; + + for (var i in src) { + print("\n=== " + src[i]); + var f = eval(src[i]); + print(src[i]); + var exp = eval(expsrc[i]); + // dis(f); + print('decompiling: ' + f); + + actual = ''; + try { expect = exp(42); f(42) } catch (e) { print('tried f(42), caught ' + e) } + reportCompare(expect, actual, summary); + + actual = ''; + try { expect = exp(43); f(43) } catch (e) { print('tried f(43), caught ' + e) } + reportCompare(expect, actual, summary); + + actual = ''; + try { expect = exp(44); f(44) } catch (e) { print('tried f(44), caught ' + e) } + reportCompare(expect, actual, summary); + } + + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-346494.js b/js/src/tests/js1_5/extensions/regress-346494.js new file mode 100644 index 000000000..bca6c4ec1 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-346494.js @@ -0,0 +1,82 @@ +/* -*- 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 = 346494; +var summary = 'try-catch-finally scope'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function g() + { + try + { + throw "foo"; + } + catch(e if e == "bar") + { + } + catch(e if e == "baz") + { + } + finally + { + } + } + + expect = "foo"; + try + { + g(); + actual = 'No Exception'; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + function h() + { + try + { + throw "foo"; + } + catch(e if e == "bar") + { + } + catch(e) + { + } + finally + { + } + } + + expect = "No Exception"; + try + { + h(); + actual = 'No Exception'; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-350312-01.js b/js/src/tests/js1_5/extensions/regress-350312-01.js new file mode 100644 index 000000000..13ebce63f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-350312-01.js @@ -0,0 +1,50 @@ +/* -*- 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 = 350312; +var summary = 'Accessing wrong stack slot with nested catch/finally'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var tmp; + + function f() + { + try { + try { + throw 1; + } catch (e) { + throw e; + } finally { + tmp = true; + } + } catch (e) { + return e; + } + } + + var ex = f(); + + var passed = ex === 1; + if (!passed) { + print("Failed!"); + print("ex="+uneval(ex)); + } + reportCompare(true, passed, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-350312-02.js b/js/src/tests/js1_5/extensions/regress-350312-02.js new file mode 100644 index 000000000..20bab7e24 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-350312-02.js @@ -0,0 +1,112 @@ +/* -*- 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 = 350312; +var summary = 'Accessing wrong stack slot with nested catch/finally'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function createPrint(obj) + { + return new Function("actual += " + obj + " + ','; " + + "print(" + obj + ");"); + } + + function createThrow(obj) + { + return new Function("throw " + obj + "; "); + } + + + function f(a, b, c) + { + try { + a(); + } catch (e if e == null) { + b(); + } finally { + c(); + } + } + + print('test 1'); + expect = 'a,c,'; + actual = ''; + try + { + f(createPrint("'a'"), createPrint("'b'"), createPrint("'c'")); + } + catch(ex) + { + actual += 'caught ' + ex; + } + reportCompare(expect, actual, summary + ': 1'); + + print('test 2'); + expect = 'c,caught a'; + actual = ''; + try + { + f(createThrow("'a'"), createPrint("'b'"), createPrint("'c'")); + } + catch(ex) + { + actual += 'caught ' + ex; + } + reportCompare(expect, actual, summary + ': 2'); + + print('test 3'); + expect = 'b,c,'; + actual = ''; + try + { + f(createThrow("null"), createPrint("'b'"), createPrint("'c'")); + } + catch(ex) + { + actual += 'caught ' + ex; + } + reportCompare(expect, actual, summary + ': 3'); + + print('test 4'); + expect = 'a,c,'; + actual = ''; + try + { + f(createPrint("'a'"), createThrow("'b'"), createPrint("'c'")); + } + catch(ex) + { + actual += 'caught ' + ex; + } + reportCompare(expect, actual, summary + ': 4'); + + print('test 5'); + expect = 'c,caught b'; + actual = ''; + try + { + f(createThrow("null"), createThrow("'b'"), createPrint("'c'")); + } + catch(ex) + { + actual += 'caught ' + ex; + } + reportCompare(expect, actual, summary + ': 5'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-350312-03.js b/js/src/tests/js1_5/extensions/regress-350312-03.js new file mode 100644 index 000000000..edf3cb49e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-350312-03.js @@ -0,0 +1,116 @@ +/* -*- 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 = 350312; +var summary = 'Accessing wrong stack slot with nested catch/finally'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var pfx = "(function (x) {try {if (x > 41) throw x}", + cg1a = " catch (e if e === 42) {var v = 'catch guard 1 ' + e; actual += v + ',';print(v);}" + cg1b = " catch (e if e === 42) {var v = 'catch guard 1 + throw ' + e; actual += v + ',';print(v); throw e;}" + cg2 = " catch (e if e === 43) {var v = 'catch guard 2 ' + e; actual += v + ',';print(v)}" + cat = " catch (e) {var v = 'catch all ' + e; print(v); if (e == 44) throw e}" + fin = " finally{var v = 'fin'; actual += v + ',';print(v)}", + end = "})"; + + var exphash = { + pfx: "(function (y) { var result = ''; y = y + ',';", + cg1a: " result += (y === '42,') ? ('catch guard 1 ' + y):'';", + cg1b: " result += (y === '42,') ? ('catch guard 1 + throw ' + y):'';", + cg2: " result += (y === '43,') ? ('catch guard 2 ' + y):'';", + cat: " result += (y > 41) ? ('catch all ' + y):'';", + fin: " result += 'fin,';", + end: "return result;})" + }; + + var src = [ + pfx + fin + end, + pfx + cat + end, + pfx + cat + fin + end, + pfx + cg1a + end, + pfx + cg1a + fin + end, + pfx + cg1a + cat + end, + pfx + cg1a + cat + fin + end, + pfx + cg1a + cg2 + end, + pfx + cg1a + cg2 + fin + end, + pfx + cg1a + cg2 + cat + end, + pfx + cg1a + cg2 + cat + fin + end, + pfx + cg1b + end, + pfx + cg1b + fin + end, + pfx + cg1b + cat + end, + pfx + cg1b + cat + fin + end, + pfx + cg1b + cg2 + end, + pfx + cg1b + cg2 + fin + end, + pfx + cg1b + cg2 + cat + end, + pfx + cg1b + cg2 + cat + fin + end, + ]; + + var expsrc = [ + exphash.pfx + exphash.fin + exphash.end, + exphash.pfx + exphash.cat + exphash.end, + exphash.pfx + exphash.cat + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1a + exphash.end, + exphash.pfx + exphash.cg1a + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1a + exphash.cat + exphash.end, + exphash.pfx + exphash.cg1a + exphash.cat + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.end, + exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.cat + exphash.end, + exphash.pfx + exphash.cg1a + exphash.cg2 + exphash.cat + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1b + exphash.end, + exphash.pfx + exphash.cg1b + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1b + exphash.cat + exphash.end, + exphash.pfx + exphash.cg1b + exphash.cat + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.end, + exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.fin + exphash.end, + exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.cat + exphash.end, + exphash.pfx + exphash.cg1b + exphash.cg2 + exphash.cat + exphash.fin + exphash.end, + ]; + + for (var i in src) { + print("\n=== " + i + ": " + src[i]); + var f = eval(src[i]); + var exp = eval(expsrc[i]); + // dis(f); + print('decompiling: ' + f); + //print('decompiling exp: ' + exp); + + actual = ''; + try { expect = exp(41); f(41) } catch (e) { print('tried f(41), caught ' + e) } + reportCompare(expect, actual, summary); + + actual = ''; + try { expect = exp(42); f(42) } catch (e) { print('tried f(42), caught ' + e) } + reportCompare(expect, actual, summary); + + actual = ''; + try { expect = exp(43); f(43) } catch (e) { print('tried f(43), caught ' + e) } + reportCompare(expect, actual, summary); + + actual = ''; + try { expect = exp(44); f(44) } catch (e) { print('tried f(44), caught ' + e) } + reportCompare(expect, actual, summary); + + actual = ''; + try { expect = exp(45); f(45) } catch (e) { print('tried f(44), caught ' + e) } + reportCompare(expect, actual, summary); + + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-350531.js b/js/src/tests/js1_5/extensions/regress-350531.js new file mode 100644 index 000000000..fcf9c74fe --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-350531.js @@ -0,0 +1,156 @@ +// |reftest| skip -- slow +/* -*- 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 = 350531; +var summary = 'exhaustively test parenthesization of binary operator subsets'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + +// Translated from permcomb.py, found at +// http://biotech.embl-ebi.ac.uk:8400/sw/common/share/python/examples/dstruct/classics/permcomb.py +// by searching for "permcomb.py". +// +// This shows bugs, gaps, and verbosities in JS compared to Python: +// 1. Lack of range([start, ] end[, step]). +// 2. ![] => false, indeed !<any-object> => false. +// 3. Missing append or push for strings (if append, then we'd want append for +// arrays too). +// 4. Missing slice operator syntax s[i:j]. +// 5. Lack of + for array concatenation. + + String.prototype.push = function (str) { return this + str; }; + + function permute(list) { + if (!list.length) // shuffle any sequence + return [list]; // empty sequence + var res = []; + for (var i = 0, n = list.length; i < n; i++) { // delete current node + var rest = list.slice(0, i).concat(list.slice(i+1)); + for each (var x in permute(rest)) // permute the others + res.push(list.slice(i, i+1).concat(x)); // add node at front + } + return res; + } + + function subset(list, size) { + if (size == 0 || !list.length) // order matters here + return [list.slice(0, 0)]; // an empty sequence + var result = []; + for (var i = 0, n = list.length; i < n; i++) { + var pick = list.slice(i, i+1); // sequence slice + var rest = list.slice(0, i).concat(list.slice(i+1)); // keep [:i] part + for each (var x in subset(rest, size-1)) + result.push(pick.concat(x)); + } + return result; + } + + function combo(list, size) { + if (size == 0 || !list.length) // order doesn't matter + return [list.slice(0, 0)]; // xyz == yzx + var result = []; + for (var i = 0, n = (list.length - size) + 1; i < n; i++) { + // iff enough left + var pick = list.slice(i, i+1); + var rest = list.slice(i+1); // drop [:i] part + for each (var x in combo(rest, size - 1)) + result.push(pick.concat(x)); + } + return result; + } + + +// Generate all subsets of distinct binary operators and join them from left +// to right, parenthesizing minimally. Decompile, recompile, compress spaces +// and compare to test correct parenthesization. + +// load("permcomb.js"); + + var bops = [ + ["=", "|=", "^=", "&=", "<<=", ">>=", ">>>=", "+=", "-=", "*=", "/=", "%="], + ["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "!=", "===", "!=="], + ["<", "<=", ">=", ">", "in", "instanceof"], + ["<<", ">>", ">>>"], + ["+", "-"], + ["*", "/", "%"], + ]; + + var prec = {}; + var aops = []; + + for (var i = 0; i < bops.length; i++) { + for (var j = 0; j < bops[i].length; j++) { + var k = bops[i][j]; + prec[k] = i; + aops.push(k); + } + } + +// Theoretically all subsets of size 2 should be enough to test, but in case +// there's some large-scale bug, try up to 5 (or higher? The cost in memory is +// factorially explosive). +next_subset: + for (i = 2; i < 5; i++) { + var sets = subset(aops, i); + gc(); + + for each (var set in sets) { + //print('for each set in sets: ' + (uneval(set)) ); + var src = "(function () {"; + for (j in set) { + var op = set[j], op2 = set[j-1]; + + // Precedence 0 is for assignment ops, which are right- + // associative, so don't force left associativity using + // parentheses. + if (prec[op] && prec[op] < prec[op2]) + src += "("; + } + src += "x "; + for (j in set) { + var op = set[j], op2 = set[j+1]; + + // Parenthesize only if not right-associative (precedence 0) and + // the next op is higher precedence than current. + var term = (prec[op] && prec[op] < prec[op2]) ? " x)" : " x"; + + src += op + term; + if (j < set.length - 1) + src += " "; + } + src += ";})"; + try { + var ref = uneval(eval(src)).replace(/\s+/g, ' '); + if (ref != src) { + actual += "BROKEN! input: " + src + " output: " + ref + " "; + print("BROKEN! input: " + src + " output: " + ref); + break next_subset; + } + } catch (e) {} + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-351102-01.js b/js/src/tests/js1_5/extensions/regress-351102-01.js new file mode 100644 index 000000000..4d569dd8c --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-351102-01.js @@ -0,0 +1,39 @@ +/* -*- 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 = 351102; +var summary = 'try/catch-guard/finally GC issues'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f; + + f = function () { + try { + throw new Error('bad'); + } catch (e if (e = null, gc(), false)) { + } catch (e) { + // e is dangling now + } + }; + + f(); + + reportCompare(expect, actual, summary + ': 1'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-351102-02.js b/js/src/tests/js1_5/extensions/regress-351102-02.js new file mode 100644 index 000000000..ce613da15 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-351102-02.js @@ -0,0 +1,45 @@ +/* -*- 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 = 351102; +var summary = 'try/catch-guard/finally GC issues'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f; + f = function () + { + var a = null; + try { + a(); + } catch (e) { + } + return false; + }; + + try { + throw 1; + } catch (e if f()) { + } catch (e if e == 1) { + print("GOOD"); + } catch (e) { + print("BAD: "+e); + } + + reportCompare(expect, actual, summary + ': 2'); + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-351102-06.js b/js/src/tests/js1_5/extensions/regress-351102-06.js new file mode 100644 index 000000000..87e897f99 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-351102-06.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 = 351102; +var summary = 'try/catch-guard/finally GC issues'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f; + try + { + try { null.a } catch(e if (e = null, gc())) { } + } + catch(ex) + { + } + reportCompare(expect, actual, summary + ': 6'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-351448.js b/js/src/tests/js1_5/extensions/regress-351448.js new file mode 100644 index 000000000..0876eef04 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-351448.js @@ -0,0 +1,62 @@ +// |reftest| skip -- Yarr doesn't have the same complexity errors at execution time. +/* -*- 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 = 351448; +var summary = 'RegExp - throw InternalError on too complex regular expressions'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var strings = [ + "/.X(.+)+X/.exec('bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+X/.exec('bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+XX/.exec('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+XX/.exec('bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+[X]/.exec('bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+[X]/.exec('bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+[X][X]/.exec('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.X(.+)+[X][X]/.exec('bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.XX(.+)+X/.exec('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.XX(.+)+X/.exec('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.XX(.+)+X/.exec('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.XX(.+)+[X]/.exec('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.XX(.+)+[X]/.exec('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.[X](.+)+[X]/.exec('bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.[X](.+)+[X]/.exec('bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.[X](.+)+[X][X]/.exec('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.[X](.+)+[X][X]/.exec('bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.[X][X](.+)+[X]/.exec('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')", + "/.[X][X](.+)+[X]/.exec('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')" + ]; + + expect = 'InternalError: regular expression too complex'; + + for (var i = 0; i < strings.length; i++) + { + try + { + eval(strings[i]); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': ' + strings[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-351463-01.js b/js/src/tests/js1_5/extensions/regress-351463-01.js new file mode 100644 index 000000000..49e5441df --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-351463-01.js @@ -0,0 +1,254 @@ +/* -*- 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 = 351463; +var summary = 'Treat hyphens as not special adjacent to CharacterClassEscapes in character classes'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var r; + var s = 'a0- z'; + + r = '([\\d-\\s]+)'; + expect = ['0- ', '0- '] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\s-\\d]+)'; + expect = ['0- ', '0- '] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\D-\\s]+)'; + expect = ['a', 'a'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\s-\\D]+)'; + expect = ['a', 'a'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\d-\\S]+)'; + expect = ['a0-', 'a0-'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\S-\\d]+)'; + expect = ['a0-', 'a0-'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\D-\\S]+)'; + expect = ['a0- z', 'a0- z'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\S-\\D]+)'; + expect = ['a0- z', 'a0- z'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + +// -- + + r = '([\\w-\\s]+)'; + expect = ['a0- z', 'a0- z'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\s-\\w]+)'; + expect = ['a0- z', 'a0- z'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\W-\\s]+)'; + expect = ['- ', '- '] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\s-\\W]+)'; + expect = ['- ', '- '] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\w-\\S]+)'; + expect = ['a0-', 'a0-'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\S-\\w]+)'; + expect = ['a0-', 'a0-'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\W-\\S]+)'; + expect = ['a0- z', 'a0- z'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + r = '([\\S-\\W]+)'; + expect = ['a0- z', 'a0- z'] + ''; + actual = null; + + try + { + actual = new RegExp(r).exec(s) + ''; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': /' + r + '/.exec("' + s + '")'); + + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-351973.js b/js/src/tests/js1_5/extensions/regress-351973.js new file mode 100644 index 000000000..008db6353 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-351973.js @@ -0,0 +1,51 @@ +/* -*- 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 = 351973; +var summary = 'GC hazard with unrooted ids in Object.toSource'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function removeAllProperties(o) + { + for (var prop in o) + delete o[prop]; + for (var i = 0; i != 50*1000; ++i) { + var tmp = Math.sqrt(i+0.2); + tmp = 0; + } + if (typeof gc == "function") + gc(); + } + + function run_test() + { + + var o = {}; + o.first = { toSource: function() { removeAllProperties(o); } }; + for (var i = 0; i != 10; ++i) { + o[Math.sqrt(i + 0.1)] = 1; + } + return o.toSource(); + } + + print(run_test()); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-352281.js b/js/src/tests/js1_5/extensions/regress-352281.js new file mode 100644 index 000000000..acb074385 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-352281.js @@ -0,0 +1,35 @@ +// |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 = 352281; +var summary = 'decompilation of |while| and function declaration'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f, g; + f = function() { { while(0) function t() { } } } + expect = 'function() { while(0) { function t() { } }}'; + actual = f + ''; + compareSource(expect, actual, summary); + + g = eval(uneval(actual)); + actual = g + ''; + compareSource(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-352291.js b/js/src/tests/js1_5/extensions/regress-352291.js new file mode 100644 index 000000000..a714e9a4c --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-352291.js @@ -0,0 +1,41 @@ +/* -*- 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 = 352291; +var summary = 'disassembly of regular expression'; +var actual = ''; +var expect = 'TypeError: /g/g is not a function'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof dis != 'function') + { + actual = expect = 'disassembly not supported, test skipped.'; + } + else + { + try + { + dis(/g/g) + } + catch(ex) + { + actual = ex + ''; + } + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-352372.js b/js/src/tests/js1_5/extensions/regress-352372.js new file mode 100644 index 000000000..088f51028 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-352372.js @@ -0,0 +1,65 @@ +/* -*- 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 = 352372; +var summary = 'Do not assert eval("setter/*...")'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 'ReferenceError: setter is not defined'; + try + { + eval("setter/*\n*/;"); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, 'eval("setter/*\n*/;")'); + + try + { + eval("setter/*\n*/g"); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, 'eval("setter/*\n*/g")'); + + try + { + eval("setter/*\n*/ ;"); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, 'eval("setter/*\n*/ ;")'); + + try + { + eval("setter/*\n*/ g"); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, 'eval("setter/*\n*/ g")'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-352604.js b/js/src/tests/js1_5/extensions/regress-352604.js new file mode 100644 index 000000000..c6197f6af --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-352604.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 = 352604; +var summary = 'Do not assert: !OBJ_GET_PROTO(cx, ctor)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f() {} + delete Function; + var g = function () {}; + + expect = f.__proto__; + actual = g.__proto__; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-354297.js b/js/src/tests/js1_5/extensions/regress-354297.js new file mode 100644 index 000000000..83a0f22f4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-354297.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 = 354297; +var summary = 'getter/setter can be on index'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + print('This test requires GC_MARK_DEBUG'); + + var o = {}; o.__defineGetter__(1, Math.sin); gc() + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-354541-01.js b/js/src/tests/js1_5/extensions/regress-354541-01.js new file mode 100644 index 000000000..c177c3be4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-354541-01.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 = 354541; +var summary = 'Regression to standard class constructors in case labels'; +var actual = ''; +var expect = ''; + + +printBugNumber(BUGNUMBER); +printStatus (summary + ': top level'); + +String.prototype.trim = function() { print('hallo'); }; + +const S = String; +const Sp = String.prototype; + +expect = 'No Error'; +actual = 'No Error'; + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + var s = Script('var tmp = function(o) { switch(o) { case String: case 1: return ""; } }; print(String === S); print(String.prototype === Sp); "".trim();'); + s(); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-354541-02.js b/js/src/tests/js1_5/extensions/regress-354541-02.js new file mode 100644 index 000000000..83019d55f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-354541-02.js @@ -0,0 +1,43 @@ +/* -*- 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 = 354541; +var summary = 'Regression to standard class constructors in case labels'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary + ': in function'); + + String.prototype.trim = function() { print('hallo'); }; + + const S = String; + const Sp = String.prototype; + + expect = 'No Error'; + actual = 'No Error'; + if (typeof Script == 'undefined') + { + print('Test skipped. Script not defined.'); + } + else + { + var s = Script('var tmp = function(o) { switch(o) { case String: case 1: return ""; } }; print(String === S); print(String.prototype === Sp); "".trim();'); + s(); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-354541-03.js b/js/src/tests/js1_5/extensions/regress-354541-03.js new file mode 100644 index 000000000..2468192e4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-354541-03.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 = 354541; +var summary = 'Regression to standard class constructors in case labels'; +var actual = ''; +var expect = ''; + + +printBugNumber(BUGNUMBER); +printStatus (summary + ': top level'); + +String.prototype.trim = function() { print('hallo'); }; + +String.prototype.trim = function() { return 'hallo'; }; + +const S = String; +const Sp = String.prototype; + +expect = 'hallo'; +var expectStringInvariant = true + var actualStringInvariant; +var expectStringPrototypeInvariant = true; +var actualStringPrototypeInvariant; + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); + reportCompare("Script not defined, Test skipped.", + "Script not defined, Test skipped.", + summary); +} +else +{ + var s = Script('var tmp = function(o) { switch(o) { case String: case 1: return ""; } }; actualStringInvariant = (String === S); actualStringPrototypeInvariant = (String.prototype === Sp); actual = "".trim();'); + try + { + s(); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, 'trim() returned'); + reportCompare(expectStringInvariant, actualStringInvariant, + 'String invariant'); + reportCompare(expectStringPrototypeInvariant, + actualStringPrototypeInvariant, + 'String.prototype invariant'); + +} + diff --git a/js/src/tests/js1_5/extensions/regress-354541-04.js b/js/src/tests/js1_5/extensions/regress-354541-04.js new file mode 100644 index 000000000..ee68b0a76 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-354541-04.js @@ -0,0 +1,60 @@ +/* -*- 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 = 354541; +var summary = 'Regression to standard class constructors in case labels'; +var actual = ''; +var expect = ''; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary + ': in function'); + + String.prototype.trim = function() { return 'hallo'; }; + + const S = String; + const Sp = String.prototype; + + expect = 'hallo'; + var expectStringInvariant = true; + var actualStringInvariant; + var expectStringPrototypeInvariant = true; + var actualStringPrototypeInvariant; + + if (typeof Script == 'undefined') + { + print('Test skipped. Script is not defined'); + reportCompare("Script not defined, Test skipped.", + "Script not defined, Test skipped.", + summary); + } + else + { + s = Script('var tmp = function(o) { switch(o) { case String: case 1: return ""; } }; actualStringInvariant = (String === S); actualStringPrototypeInvariant = (String.prototype === Sp); actual = "".trim();'); + try + { + s(); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, 'trim() returned'); + reportCompare(expectStringInvariant, actualStringInvariant, 'String invariant'); + reportCompare(expectStringPrototypeInvariant, + actualStringPrototypeInvariant, + 'String.prototype invariant'); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-355339.js b/js/src/tests/js1_5/extensions/regress-355339.js new file mode 100644 index 000000000..9b15bd742 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-355339.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 = 355339; +var summary = 'Do not assert: sprop->setter != js_watch_set'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = actual = 'No Crash'; + o = {}; + o.watch("j", function(a,b,c) { print("*",a,b,c) }); + o.unwatch("j"); + o.watch("j", function(a,b,c) { print("*",a,b,c) }); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-355497.js b/js/src/tests/js1_5/extensions/regress-355497.js new file mode 100644 index 000000000..4f69eefbf --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-355497.js @@ -0,0 +1,60 @@ +/* -*- 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 = 355497; +var summary = 'Do not overflow stack with Array.slice, getter'; +var actual = ''; +var expect = ''; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 'InternalError: too much recursion'; + + try + { + var a = { length: 1 }; + a.__defineGetter__(0, [].slice); + a[0]; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 1'); + + try + { + var b = { length: 1 }; + b.__defineGetter__(0, function () { return Array.slice(b);}); + b[0]; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 2'); + + try + { + var c = []; + c.__defineSetter__(0, c.unshift); + c[0] = 1; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 3'); + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-355622.js b/js/src/tests/js1_5/extensions/regress-355622.js new file mode 100644 index 000000000..87224a218 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-355622.js @@ -0,0 +1,34 @@ +// |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 = 355622; +var summary = 'Do not assert: overwriting'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + (function() { export arguments })(); + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-355655.js b/js/src/tests/js1_5/extensions/regress-355655.js new file mode 100644 index 000000000..9013cb1b9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-355655.js @@ -0,0 +1,45 @@ +/* -*- 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 = 355655; +var summary = 'running script can be recompiled'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print('Test skipped. Script not defined.'); + } + else + { + expect = 'TypeError: cannot compile over a script that is currently executing'; + actual = ''; + + try + { + t='1';s=Script('s.compile(t);print(t);');s(); + } + catch(ex) + { + actual = ex + ''; + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-355820.js b/js/src/tests/js1_5/extensions/regress-355820.js new file mode 100644 index 000000000..dd5de38ea --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-355820.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 = 355820; +var summary = 'Remove non-standard Script object'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + print('This test will fail in gecko prior to 1.9'); + + expect = 'undefined'; + actual = typeof Script; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-355982.js b/js/src/tests/js1_5/extensions/regress-355982.js new file mode 100644 index 000000000..815f8af15 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-355982.js @@ -0,0 +1,43 @@ +/* -*- 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 = 355982; +var summary = 'Script("") should not fail'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = 'No Error'; + actual = 'No Error'; + try + { + if (typeof Script == 'undefined') + { + print('Test skipped. Script not defined.'); + } + else + { + Script(''); + } + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-356402.js b/js/src/tests/js1_5/extensions/regress-356402.js new file mode 100644 index 000000000..33e1e6637 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-356402.js @@ -0,0 +1,23 @@ +/* -*- 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 = 356402; +var summary = 'Do not assert: slot < fp->nvars'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + (function() { new Script('for(var x in x) { }')(); })(); +} +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-358594-01.js b/js/src/tests/js1_5/extensions/regress-358594-01.js new file mode 100644 index 000000000..db6ea21b7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-358594-01.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 = 358594; +var summary = 'Do not crash on uneval(this).'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + // don't crash|assert + function f() { } + f.__proto__ = this; + Object.defineProperty(this, "m", { set: f, enumerable: true, configurable: true }); + uneval(this); + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-358594-02.js b/js/src/tests/js1_5/extensions/regress-358594-02.js new file mode 100644 index 000000000..d31d93ff5 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-358594-02.js @@ -0,0 +1,21 @@ +/* -*- 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 = 358594; +var summary = 'Do not crash on uneval(this).'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +// don't crash|assert +function f() { } +f.__proto__ = this; +Object.defineProperty(this, "m", { set: f, enumerable: true, configurable: true }); +uneval(this); +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-358594-03.js b/js/src/tests/js1_5/extensions/regress-358594-03.js new file mode 100644 index 000000000..f27c41d25 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-358594-03.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 = 358594; +var summary = 'Do not crash on uneval(this).'; +var actual = ''; +var expect = ''; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + // don't crash|assert + f = function () { }; + f.__proto__ = this; + Object.defineProperty(this, "m", { set: f, enumerable: true, configurable: true }); + uneval(this); + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-358594-04.js b/js/src/tests/js1_5/extensions/regress-358594-04.js new file mode 100644 index 000000000..5444293d0 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-358594-04.js @@ -0,0 +1,21 @@ +/* -*- 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 = 358594; +var summary = 'Do not crash on uneval(this).'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +// don't crash|assert +f = function () { }; +f.__proto__ = this; +Object.defineProperty(this, "m", { set: f, enumerable: true, configurable: true }); +uneval(this); +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-358594-05.js b/js/src/tests/js1_5/extensions/regress-358594-05.js new file mode 100644 index 000000000..0c6f9a1a4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-358594-05.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 = 358594; +var summary = 'Do not crash on uneval(this).'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + // don't crash|assert + f = function () { }; + f.hhhhhhhhh = this; + Object.defineProperty(this, "m", { set: f, enumerable: true, configurable: true }); + uneval(this); + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-358594-06.js b/js/src/tests/js1_5/extensions/regress-358594-06.js new file mode 100644 index 000000000..b4dc4fcd9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-358594-06.js @@ -0,0 +1,21 @@ +/* -*- 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 = 358594; +var summary = 'Do not crash on uneval(this).'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +// don't crash|assert +f = function () { }; +f.hhhhhhhhh = this; +Object.defineProperty(this, "m", { set: f, enumerable: true, configurable: true }); +uneval(this); +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-359024.js b/js/src/tests/js1_5/extensions/regress-359024.js new file mode 100644 index 000000000..a2a178cba --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-359024.js @@ -0,0 +1,36 @@ +/* -*- 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 = 359024; +var summary = 'Do not crash with Script...'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print(expect = actual = 'Test skipped. Script object required.'); + } + else + { + var scri=new Script(" var s=new Date(); var a=0; for(var i=0;i<1024*1024;i++) {a=i } var e=new Date(); print('time2='+(e-s)/1000);"); + scri.compile(); + scri.exec(); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-361346.js b/js/src/tests/js1_5/extensions/regress-361346.js new file mode 100644 index 000000000..297c3b1f2 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361346.js @@ -0,0 +1,22 @@ +/* -*- 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 = 361346; +var summary = 'Crash with setter, watch, GC'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expect = actual = 'No Crash'; + +Object.defineProperty(this, "x", { set: new Function, enumerable: true, configurable: true }); +this.watch('x', function(){}); +gc(); +x = {}; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-361360.js b/js/src/tests/js1_5/extensions/regress-361360.js new file mode 100644 index 000000000..98e6575d9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361360.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 = 361360; +var summary = 'Do not assert: !caller || caller->pc involving setter and watch'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = actual = 'No Crash'; + + this.__defineSetter__('x', eval); + this.watch('x', function(){}); + x = 3; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-361552.js b/js/src/tests/js1_5/extensions/regress-361552.js new file mode 100644 index 000000000..eed54e6dd --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361552.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 = 361552; +var summary = 'Crash with setter, watch, Script'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expect = actual = 'No Crash'; + +if (typeof Script == 'undefined') +{ + print('Test skipped. Script not defined.'); +} +else +{ + this.__defineSetter__('x', gc); + this.watch('x', new Script('')); + x = 3; +} +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-361558.js b/js/src/tests/js1_5/extensions/regress-361558.js new file mode 100644 index 000000000..a9a3ae725 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361558.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 = 361558; +var summary = 'Do not assert: sprop->setter != js_watch_set'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expect = actual = 'No Crash'; + +({}.__proto__.watch('x', print)); ({}.watch('x', print)); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-361571.js b/js/src/tests/js1_5/extensions/regress-361571.js new file mode 100644 index 000000000..bf89d794b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361571.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 = 361571; +var summary = 'Do not assert: fp->scopeChain == parent'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + o = {}; + o.__defineSetter__('y', eval); + o.watch('y', function () { return "";}); + o.y = 1; + } + catch(ex) + { + printStatus('Note eval can no longer be called directly'); + expect = 'EvalError: function eval must be called directly, and not by way of a function of another name'; + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-361856.js b/js/src/tests/js1_5/extensions/regress-361856.js new file mode 100644 index 000000000..e7e2f675b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361856.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 = 361856; +var summary = 'Do not assert: overwriting @ js_AddScopeProperty'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function testit() { + var obj = {}; + obj.watch("foo", function(){}); + delete obj.foo; + obj = null; + gc(); + } + testit(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-361964.js b/js/src/tests/js1_5/extensions/regress-361964.js new file mode 100644 index 000000000..fcb8bba01 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-361964.js @@ -0,0 +1,54 @@ +// |reftest| skip -- slow, alert not dismissed, now busted by harness +/* -*- 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 = 361964; +var summary = 'Crash [@ MarkGCThingChildren] involving watch and setter'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var doc; + if (typeof document == 'undefined') + { + doc = {}; + } + else + { + doc = document; + } + + if (typeof alert == 'undefined') + { + alert = print; + } + +// Crash: + doc.watch("title", function(a,b,c,d) { + return { toString : function() { alert(1); } }; + }); + doc.title = "xxx"; + +// No crash: + doc.watch("title", function() { + return { toString : function() { alert(1); } }; + }); + doc.title = "xxx"; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-363258.js b/js/src/tests/js1_5/extensions/regress-363258.js new file mode 100644 index 000000000..4e48b1261 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-363258.js @@ -0,0 +1,48 @@ +// |reftest| random -- bug 524788 +/* -*- 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 = 363258; +var summary = 'Timer resolution'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var start = 0; + var stop = 0; + var i; + var limit = 0; + var incr = 10; + var resolution = 5; + + while (stop - start == 0) + { + limit += incr; + start = Date.now(); + for (i = 0; i < limit; i++) {} + stop = Date.now(); + } + + print('limit=' + limit + ', resolution=' + resolution + ', time=' + (stop - start)); + + expect = true; + actual = (stop - start <= resolution); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-363988.js b/js/src/tests/js1_5/extensions/regress-363988.js new file mode 100644 index 000000000..76f1dccba --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-363988.js @@ -0,0 +1,47 @@ +/* -*- 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 = 363988; +var summary = 'Do not crash at JS_GetPrivate with large script'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function crash() { + var town = new Array; + + for (var i = 0; i < 0x4001; ++i) { + var si = String(i); + town[i] = [ si, "x" + si, "y" + si, "z" + si ]; + } + + return "town=" + uneval(town) + ";function f() {}"; + } + + if (typeof document != "undefined") + { + // this is required to reproduce the crash. + document.write("<script>", crash(), "<\/script>"); + } + else + { + crash(); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-365527.js b/js/src/tests/js1_5/extensions/regress-365527.js new file mode 100644 index 000000000..4f2afa2f6 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-365527.js @@ -0,0 +1,66 @@ +// |reftest| slow +/* -*- 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 = 365527; +var summary = 'JSOP_ARGUMENTS should set obj register'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + counter = 500*1000; + + var obj; + + function getter() + { + obj = { get x() { + return getter(); + }, counter: counter}; + return obj; + } + + + var x; + + function g() + { + x += this.counter; + if (--counter == 0) + throw "Done"; + } + + + function f() + { + arguments=g; + try { + for (;;) { + arguments(); + obj.x; + } + } catch (e) { + } + } + + + getter(); + f(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-365692.js b/js/src/tests/js1_5/extensions/regress-365692.js new file mode 100644 index 000000000..106b8071a --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-365692.js @@ -0,0 +1,40 @@ +/* -*- 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 = 365692; +var summary = 'getter/setter bytecodes should support atoms over 64k'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +printBugNumber(BUGNUMBER); +printStatus (summary); + +function g() +{ + return 10; +} + +try +{ + var N = 100*1000; + var src = 'var x = ["'; + var array = Array(N); + for (var i = 0; i != N; ++i) + array[i] = i; + src += array.join('","')+'"]; x.a getter = g; return x.a;'; + var f = Function(src); + if (f() != 10) + throw "Unexpected result"; +} +catch(ex) +{ + if (ex == "Unexpected result") + { + actual = ex; + } +} +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-365869.js b/js/src/tests/js1_5/extensions/regress-365869.js new file mode 100644 index 000000000..f027cf84a --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-365869.js @@ -0,0 +1,48 @@ +/* -*- 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 = 365869; +var summary = 'strict warning for object literal with duplicate propery names'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (!options().match(/strict/)) + { + options('strict'); + } + if (!options().match(/werror/)) + { + options('werror'); + } + + print('test crash from bug 371292 Comment 9'); + + try + { + expect = "TypeError: can't redefine non-configurable property 5"; + "012345".__defineSetter__(5, function(){}); + } + catch(ex) + { + actual = ex + ''; + } + + reportCompare(expect, actual, summary); + + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-366288.js b/js/src/tests/js1_5/extensions/regress-366288.js new file mode 100644 index 000000000..05f0d2565 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-366288.js @@ -0,0 +1,18 @@ +/* -*- 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 = 366288; +var summary = 'Do not assert !SPROP_HAS_STUB_GETTER with __defineSetter__'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +this.__defineSetter__("x", function(){}); +x = 3; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-366292.js b/js/src/tests/js1_5/extensions/regress-366292.js new file mode 100644 index 000000000..19879769c --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-366292.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 = 366292; +var summary = '__defineSetter__ and JSPROP_SHARED regression'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +expect = 'undefined'; +this.__defineSetter__("x", function(){}); +actual = String(x); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-366396.js b/js/src/tests/js1_5/extensions/regress-366396.js new file mode 100644 index 000000000..4369be821 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-366396.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 = 366396; +var summary = 'Do not assert !SPROP_HAS_STUB_GETTER on Setter with %='; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +this.__defineSetter__("x", function() {}); x %= 5; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-367118-01.js b/js/src/tests/js1_5/extensions/regress-367118-01.js new file mode 100644 index 000000000..83c4d59d1 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367118-01.js @@ -0,0 +1,41 @@ +/* -*- 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 = 367118; +var summary = 'memory corruption in script_compile'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print('Test skipped. Script or toSource not defined'); + } + else + { + var s = new Script(""); + var o = { + toString : function() { + s.compile(""); + Array(11).join(Array(11).join(Array(101).join("aaaaa"))); + return "a"; + } + }; + s.compile(o); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367118-02.js b/js/src/tests/js1_5/extensions/regress-367118-02.js new file mode 100644 index 000000000..d54fba896 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367118-02.js @@ -0,0 +1,41 @@ +/* -*- 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 = 367118; +var summary = 'memory corruption in script_compile'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print('Test skipped. Script or toSource not defined'); + } + else + { + var s = new Script(""); + var o = { + toString : function() { + s.compile(""); + print(1); + return "a"; + } + }; + s.compile(o); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367119-01.js b/js/src/tests/js1_5/extensions/regress-367119-01.js new file mode 100644 index 000000000..4391ab981 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367119-01.js @@ -0,0 +1,41 @@ +/* -*- 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 = 367119; +var summary = 'memory corruption in script_exec'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print('Test skipped. Script or toSource not defined'); + } + else + { + var s = new Script(""); + var o = { + valueOf : function() { + s.compile(""); + Array(11).join(Array(11).join(Array(101).join("aaaaa"))); + return {}; + } + }; + s.exec(o); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367119-02.js b/js/src/tests/js1_5/extensions/regress-367119-02.js new file mode 100644 index 000000000..990e46486 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367119-02.js @@ -0,0 +1,41 @@ +/* -*- 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 = 367119; +var summary = 'memory corruption in script_exec'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print('Test skipped. Script or toSource not defined'); + } + else + { + var s = new Script(""); + var o = { + valueOf : function() { + s.compile(""); + print(1); + return {}; + } + }; + s.exec(o); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367120-01.js b/js/src/tests/js1_5/extensions/regress-367120-01.js new file mode 100644 index 000000000..edb379b9e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367120-01.js @@ -0,0 +1,41 @@ +/* -*- 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 = 367120; +var summary = 'memory corruption in script_toSource'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined' || !('toSource' in {})) + { + print('Test skipped. Script or toSource not defined'); + } + else + { + var s = new Script(""); + var o = { + valueOf : function() { + s.compile(""); + Array(11).join(Array(11).join(Array(101).join("aaaaa"))); + return; + } + }; + s.toSource(o); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367120-02.js b/js/src/tests/js1_5/extensions/regress-367120-02.js new file mode 100644 index 000000000..cf8c3d2f5 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367120-02.js @@ -0,0 +1,41 @@ +/* -*- 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 = 367120; +var summary = 'memory corruption in script_toString'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof Script == 'undefined') + { + print('Test skipped. Script not defined.'); + } + else + { + var s = new Script(""); + var o = { + valueOf : function() { + s.compile(""); + Array(11).join(Array(11).join(Array(101).join("aaaaa"))); + return; + } + }; + s.toString(o); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367121.js b/js/src/tests/js1_5/extensions/regress-367121.js new file mode 100644 index 000000000..f74e6dfd3 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367121.js @@ -0,0 +1,64 @@ +/* -*- 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 = 367121; +var summary = 'self modifying script detection'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof window == 'undefined') + { + actual = expect = 'Test skipped - Test must be run in the browser.'; + reportCompare(expect, actual, summary); + } + else if (typeof Script == 'undefined') + { + actual = expect = 'Test skipped - Test requires Script object..'; + reportCompare(expect, actual, summary); + } + else + { + gDelayTestDriverEnd = true; + } + + exitFunc ('test'); +} + +function handleLoad() +{ + var iframe = document.body.appendChild(document.createElement('iframe')); + var d = iframe.contentDocument; + + d.addEventListener("test", function(e) { + s.compile(""); + Array(11).join(Array(11).join(Array(101).join("aaaaa"))); + }, true); + + var e = d.createEvent("Events"); + e.initEvent("test", true, true); + var s = new Script("d.dispatchEvent(e);"); + s.exec(); + + gDelayTestDriverEnd = false; + reportCompare(expect, actual, summary); + jsTestDriverEnd(); +} + +if (typeof window != 'undefined') +{ + window.onload = handleLoad; +} diff --git a/js/src/tests/js1_5/extensions/regress-367501-01.js b/js/src/tests/js1_5/extensions/regress-367501-01.js new file mode 100644 index 000000000..4a84475d0 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367501-01.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 = 367501; +var summary = 'getter/setter issues'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + expect = 'undefined'; + var a = { set x(v) {} }; + actual = a.x + ''; + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367501-02.js b/js/src/tests/js1_5/extensions/regress-367501-02.js new file mode 100644 index 000000000..8160a9a70 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367501-02.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 = 367501; +var summary = 'getter/setter crashes'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + expect = 'undefined'; + var a = { set x(v) {} }; + for (var i = 0; i < 92169 - 3; ++i) a[i] = 1; + actual = a.x + ''; + actual = a.x + ''; + } + catch(ex) + { + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367501-03.js b/js/src/tests/js1_5/extensions/regress-367501-03.js new file mode 100644 index 000000000..9d0a88c0b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367501-03.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 = 367501; +var summary = 'getter/setter crashes'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + expect = actual = 'No Crash'; + var a = { set x(v) {} }; + for (var i = 0; i < 0x4bf20 - 3; ++i) a[i] = 1; + a.x; + a.x.x; + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367501-04.js b/js/src/tests/js1_5/extensions/regress-367501-04.js new file mode 100644 index 000000000..9d4b1993b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367501-04.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 = 367501; +var summary = 'getter/setter crashes'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + expect = actual = 'No Crash'; + var a = { set x(v) {} }; + for (var i = 0; i < 0x10050c - 3; ++i) a[i] = 1; + a.x; + typeof a.x; + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-367589.js b/js/src/tests/js1_5/extensions/regress-367589.js new file mode 100644 index 000000000..14d7315bf --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-367589.js @@ -0,0 +1,49 @@ +// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow +/* -*- 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 = 367589; +var summary = 'Do not assert !SPROP_HAS_STUB_SETTER(sprop) || (sprop->attrs & JSPROP_GETTER)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof window != 'undefined') + { + gDelayTestDriverEnd = true; + document.write('<button id="button" onclick="document.getElementsByTagName(\'button\')[0] = \'wtf\';">Crash</button>'); + window.addEventListener('load', crash, false); + } + else + { + reportCompare(expect, actual, summary); + } + + exitFunc ('test'); +} + +function crash() +{ + document.getElementById('button').click(); + setTimeout(checkCrash, 0); +} + +function checkCrash() +{ + gDelayTestDriverEnd = false; + reportCompare(expect, actual, summary); + jsTestDriverEnd(); +} diff --git a/js/src/tests/js1_5/extensions/regress-369404.js b/js/src/tests/js1_5/extensions/regress-369404.js new file mode 100644 index 000000000..7e3547152 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-369404.js @@ -0,0 +1,48 @@ +/* -*- 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 = 369404; +var summary = 'Do not assert: !SPROP_HAS_STUB_SETTER(sprop) || (sprop->attrs & JSPROP_GETTER) '; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof window != 'undefined') + { + gDelayTestDriverEnd = true; + document.write('<span id="r"> </span>' + + '<script>' + + 'f = function(){};' + + 'f.prototype = document.getElementById("r").childNodes;' + + 'j = new f();' + + 'j[0] = null;' + + '</script>'); + window.addEventListener('load', crash, false); + } + else + { + reportCompare(expect, actual, summary); + } + + exitFunc ('test'); +} + +function crash() +{ + gDelayTestDriverEnd = false; + reportCompare(expect, actual, summary); + jsTestDriverEnd(); +} diff --git a/js/src/tests/js1_5/extensions/regress-369696-01.js b/js/src/tests/js1_5/extensions/regress-369696-01.js new file mode 100644 index 000000000..985ae0f35 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-369696-01.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 = 369696; +var summary = 'Do not assert: map->depth > 0" in js_LeaveSharpObject'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + q = []; + q.__defineGetter__("0", q.toString); + q[2] = q; + assertEq(q.toSource(), "[\"\", , []]", "wrong string"); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-369696-02.js b/js/src/tests/js1_5/extensions/regress-369696-02.js new file mode 100644 index 000000000..1784d977c --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-369696-02.js @@ -0,0 +1,58 @@ +/* -*- 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 = 369696; +var summary = 'Do not assert: map->depth > 0" in js_LeaveSharpObject'; +var actual = ''; +var expect = ''; + +// Bug 762908 requires us to set sp=null; +if (this.window) window.SpecialPowers = null; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function fun() {} + n = fun.prototype; + n.__defineGetter__("prototype", n.toSource); + p = n.__lookupGetter__("prototype"); + n = p; + + assertEq(n, Object.prototype.toSource); + assertEq(p, Object.prototype.toSource); + + n["prototype"] = [n]; + n = p; + + assertEq(n, Object.prototype.toSource); + assertEq(p, Object.prototype.toSource); + + p2 = n["prototype"]; + + assertEq(Array.isArray(p2), true); + assertEq(p2[0], Object.prototype.toSource); + + n = p2; + + assertEq(n.toString, Array.prototype.toString); + n.__defineGetter__("0", n.toString); + n = p; + + assertEq(n, Object.prototype.toSource); + + n.call(this); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-369696-03.js b/js/src/tests/js1_5/extensions/regress-369696-03.js new file mode 100644 index 000000000..da52ab8d6 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-369696-03.js @@ -0,0 +1,47 @@ +/* -*- 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 = 369696; +var summary = 'Do not assert: map->depth > 0" in js_LeaveSharpObject'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var x = [[[ { toSource: function() { gc(); }}]]]; + + var a = []; + a[0] = a; + a.toSource = a.toString; + Array.prototype.toSource.call(a); + +//cx->sharpObjectMap.depth == -2 + + (function() { + var tmp = []; + for (var i = 0; i != 30*1000; ++i) { + var tmp2 = []; + tmp.push(tmp2); + tmp2.toSource(); + } + })(); + + gc(); + x.toSource(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-372309.js b/js/src/tests/js1_5/extensions/regress-372309.js new file mode 100644 index 000000000..278ee0a89 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-372309.js @@ -0,0 +1,47 @@ +/* -*- 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 = 372309; +var summary = 'Root new array objects'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var width = 600; + var height = 600; + + var img1canvas = document.createElement("canvas"); + var img2canvas = document.createElement("canvas"); + + img1canvas.width = img2canvas.width = width; + img1canvas.height = img2canvas.height = height; + img1canvas.getContext("2d").getImageData(0, 0, width, height).data; + img2canvas.getContext("2d").getImageData(0, 0, width, height).data; + + reportCompare(expect, actual, summary); + gDelayTestDriverEnd = false; + jsTestDriverEnd(); + + exitFunc ('test'); +} + +if (typeof window != 'undefined') +{ + // delay test driver end + gDelayTestDriverEnd = true; + + window.addEventListener("load", test, false); +} +else +{ + reportCompare(expect, actual, summary); +} + diff --git a/js/src/tests/js1_5/extensions/regress-374589.js b/js/src/tests/js1_5/extensions/regress-374589.js new file mode 100644 index 000000000..829c5dcc3 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-374589.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 = 374589; +var summary = 'Do not assert decompiling try { } catch(x if true) { } ' + + 'catch(y) { } finally { this.a.b; }'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var f = function () { + try { } catch(x if true) { } catch(y) { } finally { this.a.b; } }; + + expect = 'function () { try { } catch(x if true) { } catch(y) { } ' + + 'finally { this.a.b; } }'; + + actual = f + ''; + compareSource(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-375183.js b/js/src/tests/js1_5/extensions/regress-375183.js new file mode 100644 index 000000000..e41751a1b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-375183.js @@ -0,0 +1,62 @@ +/* -*- 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 = 375183; +var summary = '__noSuchMethod__ should not allocate beyond fp->script->depth'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var obj = { get __noSuchMethod__() { + print("Executed"); + return new Object(); + }}; + + try + { + obj.x(); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary + ':1'); + + obj = { __noSuchMethod__: {} }; + try + { + obj.x(); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary + ':2'); + + obj = { } + obj.__noSuchMethod__ = {}; + try + { + obj.x(); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary + ':3'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-375344.js b/js/src/tests/js1_5/extensions/regress-375344.js new file mode 100644 index 000000000..41d9eeb15 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-375344.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 = 375344; +var summary = 'accessing prototype of DOM objects should throw catchable error'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof HTMLElement != 'undefined') +{ + expect = /TypeError/; + try + { + print(HTMLElement.prototype.nodeName); + } + catch(ex) + { + actual = ex + ''; + print(actual); + } + reportMatch(expect, actual, summary); +} +else +{ + expect = actual = 'Test can only run in a Gecko 1.9 browser or later.'; + print(actual); + reportCompare(expect, actual, summary); +} diff --git a/js/src/tests/js1_5/extensions/regress-375801.js b/js/src/tests/js1_5/extensions/regress-375801.js new file mode 100644 index 000000000..2ed40ae99 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-375801.js @@ -0,0 +1,36 @@ +/* -*- 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 = 375801; +var summary = 'uneval should use "(void 0)" instead of "undefined"'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '({a: (void 0)})' + actual = uneval({a: undefined}) + compareSource(expect, actual, summary + ': uneval'); + + expect = 'function() {({a: undefined});}'; + actual = (function() {({a: undefined});}).toString(); + compareSource(expect, actual, summary + ': toString'); + + expect = '(function () {({a: undefined});})'; + actual = (function () {({a: undefined});}).toSource(); + compareSource(expect, actual, summary + ': toSource'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-380581.js b/js/src/tests/js1_5/extensions/regress-380581.js new file mode 100644 index 000000000..504a6f79d --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-380581.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 = 380581; +var summary = 'Incorrect uneval with setter in object literal'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '(function() { })'; + actual = uneval(eval("(function() { })")); + compareSource(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-380889.js b/js/src/tests/js1_5/extensions/regress-380889.js new file mode 100644 index 000000000..b0e03d666 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-380889.js @@ -0,0 +1,40 @@ +/* -*- 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 = 380889; +var summary = 'Source disassembler assumes SRC_SWITCH has jump table'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f(i) + { + switch(i){ + case 1: + case xyzzy: + } + } + + if (typeof dis != 'undefined') + { + dis(f); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-381211.js b/js/src/tests/js1_5/extensions/regress-381211.js new file mode 100644 index 000000000..079843336 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-381211.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 = 381211; +var summary = 'uneval with getter'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '( { get x() {} } )'; + actual = uneval({get x(){}}); + compareSource(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-381304.js b/js/src/tests/js1_5/extensions/regress-381304.js new file mode 100644 index 000000000..603b81fba --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-381304.js @@ -0,0 +1,69 @@ +/* -*- 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 = 381304; +var summary = 'getter/setter with keywords'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var obj; + + print('1'); + + obj = { + set inn(value) {this.for = value;}, + get inn() {return this.for;} + }; + + expect = '({get inn() { return this.for; }, set inn(value) { this.for = value; } })'; + actual = obj.toSource(); + compareSource(expect, actual, summary + ': 1'); + + print('2'); + + obj = { + set in(value) {this.for = value;}, + get in() {return this.for;} + }; + + expect = '({ get in() { return this.for; }, set in(value) { this.for = value; } })'; + actual = obj.toSource(); + compareSource(expect, actual, summary + ': 2'); + + print('3'); + + obj = { + set inn(value) {this.for = value;}, + get in() {return this.for;} + }; + + expect = '({ set inn(value) { this.for = value; }, get in() { return this.for; } })'; + actual = obj.toSource(); + compareSource(expect, actual, summary + ': 4'); + + print('4'); + + obj = { + set in(value) {this.for = value;}, + get inn() {return this.for;} + }; + + expect = ' ({ set in(value) { this.for = value; }, get inn() { return this.for; } })'; + actual = obj.toSource(); + compareSource(expect, actual, summary + ': 5'); + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-385134.js b/js/src/tests/js1_5/extensions/regress-385134.js new file mode 100644 index 000000000..041f4d6e7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-385134.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 = 385134; +var summary = 'Do not crash with setter, watch, uneval'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof this.__defineSetter__ != 'undefined' && + typeof this.watch != 'undefined' && + typeof uneval != 'undefined') + { + try { + this.__defineSetter__(0, function(){}); + } catch (exc) { + // In the browser, this fails. Ignore the error. + } + this.watch(0, function(){}); + uneval(this); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-385393-02.js b/js/src/tests/js1_5/extensions/regress-385393-02.js new file mode 100644 index 000000000..a23efb5af --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-385393-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 = 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); + + try + { + (4).__lookupGetter__("w"); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-385393-09.js b/js/src/tests/js1_5/extensions/regress-385393-09.js new file mode 100644 index 000000000..42834824a --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-385393-09.js @@ -0,0 +1,18 @@ +/* -*- 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'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +eval("this.__defineSetter__('x', gc); this.watch('x', [].slice); x = 1;"); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-390597.js b/js/src/tests/js1_5/extensions/regress-390597.js new file mode 100644 index 000000000..9f8596adc --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-390597.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 = 390597; +var summary = 'watch point + eval-as-setter allows access to dead JSStackFrame'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function exploit() { + try + { + var obj = this, args = null; + obj.__defineSetter__("evil", eval); + obj.watch("evil", function() { return "args = arguments;"; }); + obj.evil = null; + eval("print(args[0]);"); + } + catch(ex) + { + print('Caught ' + ex); + } + } + exploit(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-390598.js b/js/src/tests/js1_5/extensions/regress-390598.js new file mode 100644 index 000000000..46167bc81 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-390598.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 = 390598; +var summary = 'array_length_setter is exploitable'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function exploit() { + var fun = function () {}; + fun.__proto__ = []; + fun.length = 0x50505050 >> 1; + fun(); + } + exploit(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-394967.js b/js/src/tests/js1_5/extensions/regress-394967.js new file mode 100644 index 000000000..e1ed16af7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-394967.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 = 394967; +var summary = 'Do not assert: !vp[1].isPrimitive()'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof evalcx == 'undefined') + { + print('Skipping. This test requires evalcx.'); + } + else + { + var sandbox = evalcx(""); + try + { + evalcx("(1)()", sandbox); + } + catch(ex) + { + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-396326.js b/js/src/tests/js1_5/extensions/regress-396326.js new file mode 100644 index 000000000..4c927b44e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-396326.js @@ -0,0 +1,48 @@ +/* -*- 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 = 396326; +var summary = 'Do not assert trying to disassemble get(var|arg) prop'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof dis == 'undefined') + { + print('disassembly not supported. test skipped.'); + reportCompare(expect, actual, summary); + } + else + { + function f1() { var v; return v.prop }; + dis(f1); + reportCompare(expect, actual, summary + + ': function f1() { var v; return v.prop };'); + + function f2(arg) { return arg.prop }; + dis(f2); + reportCompare(expect, actual, summary + + ': function f2(arg) { return arg.prop };'); + + function f3() { return this.prop }; + dis(f3); + reportCompare(expect, actual, summary + + ': function f3() { return this.prop };'); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-406572.js b/js/src/tests/js1_5/extensions/regress-406572.js new file mode 100644 index 000000000..4911d05bc --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-406572.js @@ -0,0 +1,47 @@ +/* -*- 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 = 406572; +var summary = 'JSOP_CLOSURE unconditionally replaces properties of the variable object - Browser only'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof window != 'undefined') +{ + try { + actual = "FAIL: Unexpected exception thrown"; + + var win = window; + var windowString = String(window); + window = 1; + reportCompare(windowString, String(window), "window should be readonly"); + + if (1) + function window() { return 1; } + + // We should reach this line without throwing. Annex B means the + // block-scoped function above gets an assignment to 'window' in the + // nearest 'var' environment, but since 'window' is read-only, the + // assignment silently fails. + actual = ""; + + // The test harness might rely on window having its original value: + // restore it. + window = win; + } catch (e) { + } +} +else +{ + expect = actual = 'Test can only run in a Gecko 1.9 browser or later.'; + print(actual); +} +reportCompare(expect, actual, summary); + + diff --git a/js/src/tests/js1_5/extensions/regress-407501.js b/js/src/tests/js1_5/extensions/regress-407501.js new file mode 100644 index 000000000..444f76e11 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-407501.js @@ -0,0 +1,42 @@ +// |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 = 407501; +var summary = 'JSOP_NEWINIT lacks SAVE_SP_AND_PC '; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof gczeal == 'function') + { + gczeal(2); + } + + var a = [[[[[[[0]]]]]]]; + if (uneval(a).length == 0) + throw "Unexpected result"; + + if (typeof gczeal == 'function') + { + gczeal(0); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} + diff --git a/js/src/tests/js1_5/extensions/regress-407720.js b/js/src/tests/js1_5/extensions/regress-407720.js new file mode 100644 index 000000000..9ecfedfce --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-407720.js @@ -0,0 +1,52 @@ +// |reftest| skip-if(!xulRuntime.shell) slow +/* -*- 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 = 407720; +var summary = 'js_FindClassObject causes crashes with getter/setter - Browser only'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +// stop the test after 60 seconds +var start = new Date(); + +if (typeof document != 'undefined') +{ + // delay test driver end + gDelayTestDriverEnd = true; + document.write('<iframe onload="onLoad()"><\/iframe>'); +} +else +{ + actual = 'No Crash'; + reportCompare(expect, actual, summary); +} + +function onLoad() +{ + + if ( (new Date() - start) < 60*1000) + { + var x = frames[0].Window.prototype; + x.a = x.b = x.c = 1; + x.__defineGetter__("HTML document.all class", function() {}); + frames[0].document.all; + + // retry + frames[0].location = "about:blank"; + } + else + { + actual = 'No Crash'; + + reportCompare(expect, actual, summary); + gDelayTestDriverEnd = false; + jsTestDriverEnd(); + } +} diff --git a/js/src/tests/js1_5/extensions/regress-412926.js b/js/src/tests/js1_5/extensions/regress-412926.js new file mode 100644 index 000000000..4ab3e671b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-412926.js @@ -0,0 +1,57 @@ +/* -*- 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 = 412926; +var summary = 'JS_ValueToId(cx, JSVAL_NULL) should return atom for "null" string'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + actual = expect = 'No Errors'; + + var obj = { 'null': 1 }; + + var errors = []; + + if (!obj.hasOwnProperty(null)) + errors.push('null property is not owned'); + + if (!obj.propertyIsEnumerable(null)) + errors.push('null property is not enumerable'); + + var getter_was_called = false; + obj.__defineGetter__(null, function() { getter_was_called = true; return 1; }); + obj['null']; + + if (!getter_was_called) + errors.push('getter was not assigned to the null property'); + + var setter_was_called = false; + obj.__defineSetter__(null, function() { setter_was_called = true; }); + obj['null'] = 2; + + if (!setter_was_called) + errors.push('setter was not assigned to the null property'); + + if (errors.length) + actual = errors.join('; '); + + gc(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-414755.js b/js/src/tests/js1_5/extensions/regress-414755.js new file mode 100644 index 000000000..7a4affe27 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-414755.js @@ -0,0 +1,54 @@ +// |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 = 414755; +var summary = 'GC hazard due to missing SAVE_SP_AND_PC'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f() + { + var a = 1e10; + var b = 2e10; + var c = 3e10; + + return (a*2) * ((b*2) * c); + } + + if (typeof gczeal == 'function') + { + expect = f(); + + gczeal(2); + + actual = f(); + } + else + { + expect = actual = 'Test requires gczeal, skipped.'; + } + + if (typeof gczeal == 'function') + { + gczeal(0); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-416354.js b/js/src/tests/js1_5/extensions/regress-416354.js new file mode 100644 index 000000000..21432585e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-416354.js @@ -0,0 +1,48 @@ +// |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 = 416354; +var summary = 'GC hazard due to missing SAVE_SP_AND_PC'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f(a, b, c) + { + return (-a) * ((-b) * (-c)); + } + + if (typeof gczeal == 'function') + { + expect = f(1.5, 1.25, 1.125); + gczeal(2); + actual = f(1.5, 1.25, 1.125); + } + else + { + expect = actual = 'Test requires gczeal, skipped.'; + } + + if (typeof gczeal == 'function') + { + gczeal(0); + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-416460.js b/js/src/tests/js1_5/extensions/regress-416460.js new file mode 100644 index 000000000..7131f0217 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-416460.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 = 416460; +var summary = 'Do not assert: SCOPE_GET_PROPERTY(OBJ_SCOPE(pobj), ATOM_TO_JSID(atom))'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + /a/.__proto__.__proto__ = { "2": 3 }; + var b = /b/; + b["2"]; + b["2"]; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-416834.js b/js/src/tests/js1_5/extensions/regress-416834.js new file mode 100644 index 000000000..ffd145cf3 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-416834.js @@ -0,0 +1,20 @@ +/* -*- 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 = 416834; +var summary = 'Do not assert: !entry || entry->kpc == ((PCVCAP_TAG(entry->vcap) > 1) ? (jsbytecode *) JSID_TO_ATOM(id) : cx->fp->pc)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +this.__proto__.x = eval; +for (i = 0; i < 16; ++i) + delete eval; +(function w() { x = 1; })(); + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-418730.js b/js/src/tests/js1_5/extensions/regress-418730.js new file mode 100644 index 000000000..4c7d9d26f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-418730.js @@ -0,0 +1,32 @@ +// |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 = 418730; +var summary = 'export * should not halt script'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +for (var i = 0; i < 60; ++i) + this["v" + i] = true; + +expect = 'PASS'; +actual = 'FAIL'; + +try { + print("GO"); + export *; + print("PASS (1)"); +} catch(e) { + print("PASS (2)"); +} + +actual = 'PASS'; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-420612.js b/js/src/tests/js1_5/extensions/regress-420612.js new file mode 100644 index 000000000..a4491095e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-420612.js @@ -0,0 +1,21 @@ +/* -*- 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 = 420612; +var summary = 'Do not assert: obj == pobj'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var obj = Object.create([]); +obj.unwatch("x"); + +if (typeof reportCompare === "function") + reportCompare(true, true); + +print("Tests complete"); diff --git a/js/src/tests/js1_5/extensions/regress-420869-01.js b/js/src/tests/js1_5/extensions/regress-420869-01.js new file mode 100644 index 000000000..a3205dd13 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-420869-01.js @@ -0,0 +1,40 @@ +/* -*- 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 = 420869; +var summary = 'Throw too much recursion instead of script stack space quota'; +var actual = 'No Error'; +var expect = 'InternalError: too much recursion'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f(i) { + if (i == 0) + return 1; + return i*f(i-1); + } + + try + { + f(); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-421621.js b/js/src/tests/js1_5/extensions/regress-421621.js new file mode 100644 index 000000000..63532f485 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-421621.js @@ -0,0 +1,22 @@ +// |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 = 421621; +var summary = 'Do not assert with setter, export/import: (sprop)->slot != SPROP_INVALID_SLOT || !SPROP_HAS_STUB_SETTER(sprop)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var th = this; +this.__defineSetter__('x', function () {}); +export *; +import th.*; +x; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-422592.js b/js/src/tests/js1_5/extensions/regress-422592.js new file mode 100644 index 000000000..18f33d9eb --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-422592.js @@ -0,0 +1,68 @@ +/* -*- 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 = 422592; +var summary = 'js.c dis/dissrc should not kill script execution'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof dis == 'undefined') + { + expect = actual = 'Test requires function dis. Not tested'; + print(expect); + } + else + { + expect = 'Completed'; + actual = 'Not Completed'; + print('Before dis'); + try + { + dis(print); + } + catch(ex) + { + } + print('After dis'); + actual = 'Completed'; + } + reportCompare(expect, actual, summary); + + if (typeof dissrc == 'undefined') + { + expect = actual = 'Test requires function dissrc. Not tested'; + print(expect); + } + else + { + print('Before dissrc'); + expect = 'Completed'; + actual = 'Not Completed'; + try + { + dissrc(print); + } + catch(ex) + { + } + print('After dissrc'); + actual = 'Completed'; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-424683-01.js b/js/src/tests/js1_5/extensions/regress-424683-01.js new file mode 100644 index 000000000..8786aa319 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-424683-01.js @@ -0,0 +1,36 @@ +/* -*- 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 = 424683; +var summary = 'Throw too much recursion instead of script stack space quota'; +var actual = 'No Error'; +var expect = 'InternalError: too much recursion'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function f() { f(); } + + try + { + f(); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-426711.js b/js/src/tests/js1_5/extensions/regress-426711.js new file mode 100644 index 000000000..819aad1f9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-426711.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 = 426711; +var summary = 'Setting window.__count__ causes a crash'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof window != 'undefined' && '__count__' in window) + { + window.__count__ = 0; + } + else + { + expect = actual = 'Test skipped. Requires window.__count__'; + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-427196-01.js b/js/src/tests/js1_5/extensions/regress-427196-01.js new file mode 100644 index 000000000..8d622cf2a --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-427196-01.js @@ -0,0 +1,40 @@ +/* -*- 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 = 427196; +var summary = 'Do not assert: OBJ_SCOPE(pobj)->object == pobj'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function boom() + { + var b = {}; + Array.__proto__ = b; + b.__proto__ = {}; + var c = {}; + c.__proto__ = []; + try { c.__defineSetter__("t", undefined); } catch(e) { } + c.__proto__ = Array; + try { c.__defineSetter__("v", undefined); } catch(e) { } + } + + boom(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-427196-02.js b/js/src/tests/js1_5/extensions/regress-427196-02.js new file mode 100644 index 000000000..2ae4c6121 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-427196-02.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 = 427196; +var summary = 'Do not assert: OBJ_SCOPE(pobj)->object == pobj'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + function boom() + { + var c = {__proto__: []}; + var a = {__proto__: {__proto__: {}}}; + c.hasOwnProperty("t"); + c.__proto__ = a; + c.hasOwnProperty("v"); + } + + boom(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-427196-03.js b/js/src/tests/js1_5/extensions/regress-427196-03.js new file mode 100644 index 000000000..9e618ffab --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-427196-03.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 = 427196; +var summary = 'Do not assert: OBJ_SCOPE(pobj)->object == pobj'; +var actual = ''; +var expect = ''; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var c = {__proto__: []}; + var a = {__proto__: {__proto__: {}}}; + c.hasOwnProperty; + c.__proto__ = a; + c.hasOwnProperty; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-429739.js b/js/src/tests/js1_5/extensions/regress-429739.js new file mode 100644 index 000000000..fd38b9efe --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-429739.js @@ -0,0 +1,36 @@ +/* -*- 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 = 429739; +var summary = 'Do not assert: OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_HAS_PRIVATE'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var actual; + try + { + var o = { __noSuchMethod__: Function }; + actual = (new o.y) + ''; + throw new Error("didn't throw, produced a value"); + } + catch(ex) + { + actual = ex; + } + + reportCompare("TypeError", actual.name, "bad error name"); + reportCompare(true, /is not a constructor/.test(actual), summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-432075.js b/js/src/tests/js1_5/extensions/regress-432075.js new file mode 100644 index 000000000..7fa63fed3 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-432075.js @@ -0,0 +1,25 @@ +// |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 = 432075; +var summary = 'A function decompiles as [object Function] after export/import'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var a = Function; +var t = this; +export *; +import t.*; +Function = a; + +expect = 'function anonymous() {}'; +actual = (new Function("")) + ''; + +compareSource(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-434837-01.js b/js/src/tests/js1_5/extensions/regress-434837-01.js new file mode 100644 index 000000000..571ed68d7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-434837-01.js @@ -0,0 +1,90 @@ +/* -*- 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 = 434837; +var summary = '|this| in accessors in prototype chain of array'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + expect = true; + actual = null; + x = [ "one", "two" ]; + Array.prototype.__defineGetter__('test1', function() { actual = (this === x); }); + x.test1; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': x.test1'); + + try + { + expect = false; + actual = null; + Array.prototype.__defineGetter__('test2', function() { actual = (this === Array.prototype) }); + x.test2; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': x.test2'); + + Array.prototype.__defineGetter__('test3', function() { actual = (this === x) }); + Array.prototype.__defineSetter__('test3', function() { actual = (this === x) }); + + try + { + expect = true; + actual = null; + x.test3; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': x.test3 (1)'); + + try + { + expect = true; + actual = null; + x.test3 = 5; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': x.test3 = 5'); + + try + { + expect = true; + actual = null; + x.test3; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': x.test3 (2)'); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-435345-01.js b/js/src/tests/js1_5/extensions/regress-435345-01.js new file mode 100644 index 000000000..28beab473 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-435345-01.js @@ -0,0 +1,100 @@ +// |reftest| fails +/* -*- 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 = 435345; +var summary = 'Watch the length property of arrays'; +var actual = ''; +var expect = ''; + +// see http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Object:watch + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var arr; + + try + { + expect = 'watcher: propname=length, oldval=0, newval=1; '; + actual = ''; + arr = []; + arr.watch('length', watcher); + arr[0] = '0'; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 1'); + + try + { + expect = 'watcher: propname=length, oldval=1, newval=2; ' + + 'watcher: propname=length, oldval=2, newval=2; '; + actual = ''; + arr.push(5); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 2'); + + try + { + expect = 'watcher: propname=length, oldval=2, newval=1; '; + actual = ''; + arr.pop(); + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 3'); + + try + { + expect = 'watcher: propname=length, oldval=1, newval=2; '; + actual = ''; + arr.length++; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 4'); + + try + { + expect = 'watcher: propname=length, oldval=2, newval=5; '; + actual = ''; + arr.length = 5; + } + catch(ex) + { + actual = ex + ''; + } + reportCompare(expect, actual, summary + ': 5'); + + exitFunc ('test'); +} + +function watcher(propname, oldval, newval) +{ + actual += 'watcher: propname=' + propname + ', oldval=' + oldval + + ', newval=' + newval + '; '; + + return newval; +} + diff --git a/js/src/tests/js1_5/extensions/regress-435497-01.js b/js/src/tests/js1_5/extensions/regress-435497-01.js new file mode 100644 index 000000000..524e48bb0 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-435497-01.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 = 435497; +var summary = 'Do not assert op2 == JSOP_INITELEM'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + eval('(function() { x, x setter = 0, y; const x; })();'); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-435497-02.js b/js/src/tests/js1_5/extensions/regress-435497-02.js new file mode 100644 index 000000000..a61fdaa20 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-435497-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 = 435497; +var summary = 'Do not assert op2 == JSOP_INITELEM'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + eval('(function() { x setter = 0, y; const x; })();'); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-435497-03.js b/js/src/tests/js1_5/extensions/regress-435497-03.js new file mode 100644 index 000000000..619ea6473 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-435497-03.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 = 435497; +var summary = 'Do not assert op2 == JSOP_INITELEM'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + try + { + eval('(function() { x getter= function(){} ; var x5, x = 0x99; })();'); + } + catch(ex) + { + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-436741.js b/js/src/tests/js1_5/extensions/regress-436741.js new file mode 100644 index 000000000..be85e5a8d --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-436741.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 = 436741; +var summary = 'Do not assert: OBJ_IS_NATIVE(obj)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof window == 'undefined') + { + print('This test is only meaningful in the browser.'); + } + else + { + try { window.__proto__.__proto__ = [{}]; } catch (e) {} + for (var j in window); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-437288-01.js b/js/src/tests/js1_5/extensions/regress-437288-01.js new file mode 100644 index 000000000..5a8ea6e38 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-437288-01.js @@ -0,0 +1,29 @@ +// |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 = 437288; +var summary = 'for loop turning into a while loop'; +var actual = 'No Hang'; +var expect = 'No Hang'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + (function() { const x = 1; for (x in null); })(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-44009.js b/js/src/tests/js1_5/extensions/regress-44009.js new file mode 100644 index 000000000..def7fb679 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-44009.js @@ -0,0 +1,52 @@ +/* -*- 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/. */ + +/* + * Date: 26 Feb 2001 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=44009 + * + * SUMMARY: Testing that we don't crash on obj.toSource() + */ +//----------------------------------------------------------------------------- +var BUGNUMBER = 44009; +var summary = "Testing that we don't crash on obj.toSource()"; +var obj1 = {}; +var sToSource = ''; +var self = this; //capture a reference to the global JS object - + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + var obj2 = {}; + + // test various objects and scopes - + testThis(self); + testThis(this); + testThis(obj1); + testThis(obj2); + + reportCompare('No Crash', 'No Crash', ''); + + exitFunc ('test'); +} + + +// We're just testing that we don't crash by doing this - +function testThis(obj) +{ + sToSource = obj.toSource(); + obj.prop = obj; + sToSource = obj.toSource(); +} diff --git a/js/src/tests/js1_5/extensions/regress-443569.js b/js/src/tests/js1_5/extensions/regress-443569.js new file mode 100644 index 000000000..a0d3beb87 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-443569.js @@ -0,0 +1,41 @@ +/* -*- 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 = 443569; +var summary = 'Do not assert: OBJ_IS_NATIVE(obj)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +printBugNumber(BUGNUMBER); +printStatus (summary); + +if (typeof window != 'undefined') +{ + // delay test driver end + gDelayTestDriverEnd = true; + + window.addEventListener("load", boom, false); +} +else +{ + reportCompare(expect, actual, summary); +} + +function boom() +{ + var r = RegExp.prototype; + r["-1"] = 0; + Array.prototype.__proto__ = r; + []["-1"]; + + reportCompare(expect, actual, summary); + + gDelayTestDriverEnd = false; + jsTestDriverEnd(); +} + + diff --git a/js/src/tests/js1_5/extensions/regress-446386.js b/js/src/tests/js1_5/extensions/regress-446386.js new file mode 100644 index 000000000..b176d9922 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-446386.js @@ -0,0 +1,47 @@ +/* -*- 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 = 446386; +var summary = 'Do not crash throwing error without compiler pseudo-frame'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof evalcx == 'undefined') + { + print(expect = actual = 'Test skipped. evalcx required.'); + } + else { + try + { + try { + evalcx("."); + throw "must throw"; + } catch (e) { + if (e.name != "SyntaxError") + throw e; + } + } + catch(ex) + { + actual = ex + ''; + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-452168.js b/js/src/tests/js1_5/extensions/regress-452168.js new file mode 100644 index 000000000..20c33f5be --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-452168.js @@ -0,0 +1,42 @@ +// |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 = 452168; +var summary = 'Do not crash with gczeal 2, JIT: @ avmplus::List or @ nanojit::LirBuffer::validate'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof gczeal == 'undefined') + { + expect = actual = 'Test requires gczeal, skipped.'; + } + else + { + // Enumerate the global once before we turn on gczeal, so we're not + // trying to do all the enumerate hook object creation with a gc on + // every object, because that makes tests time out. + for (z in this); + gczeal(2); + + var a, b; gczeal(2); (function() { for (var p in this) { } })(); + + gczeal(0); + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-452178.js b/js/src/tests/js1_5/extensions/regress-452178.js new file mode 100644 index 000000000..9f69fdebe --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-452178.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 = 452178; +var summary = 'Do not assert with JIT: !(sprop->attrs & JSPROP_SHARED)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + Object.defineProperty(this, "q", { get: function(){}, enumerable: true, configurable: true }); + for (var j = 0; j < 4; ++j) q = 1; + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-452329.js b/js/src/tests/js1_5/extensions/regress-452329.js new file mode 100644 index 000000000..40f235a59 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-452329.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 = 452329; +var summary = 'Do not assert: *data->pc == JSOP_CALL || *data->pc == JSOP_NEW'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + this.__defineGetter__("x", "".match); if (x) 3; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-452338.js b/js/src/tests/js1_5/extensions/regress-452338.js new file mode 100644 index 000000000..9b2203702 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-452338.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 = 452338; +var summary = 'Do not assert with JIT: obj2 == obj'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for (var j = 0; j < 4; ++j) __count__ = 3; + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-452565.js b/js/src/tests/js1_5/extensions/regress-452565.js new file mode 100644 index 000000000..6ca0e87c4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-452565.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 = 452565; +var summary = 'Do not assert with JIT: !(sprop->attrs & JSPROP_READONLY)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +var c = undefined; (function() { for (var j=0;j<5;++j) { c = 1; } })(); + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-453249.js b/js/src/tests/js1_5/extensions/regress-453249.js new file mode 100644 index 000000000..910353da9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-453249.js @@ -0,0 +1,21 @@ +/* -*- 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 = 453249; +var summary = 'Do not assert with JIT: s0->isQuad()'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +this.__proto__.a = 3; for (var j = 0; j < 4; ++j) { [a]; } + +this.a = 3; for (var j = 0; j < 4; ++j) { [a]; } + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-454040.js b/js/src/tests/js1_5/extensions/regress-454040.js new file mode 100644 index 000000000..63b5e1488 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-454040.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 = 454040; +var summary = 'Do not crash @ js_ComputeFilename'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +try +{ + this.__defineGetter__("x", Function); + this.__defineSetter__("x", Function); + this.watch("x", x.__proto__); + x = 1; +} +catch(ex) +{ +} +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-454142.js b/js/src/tests/js1_5/extensions/regress-454142.js new file mode 100644 index 000000000..05f331278 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-454142.js @@ -0,0 +1,30 @@ +// |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 = 454142; +var summary = 'Do not crash with gczeal, setter, watch'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +this.watch("x", function(){}); +delete x; +if (typeof gczeal == 'function') +{ + gczeal(2); +} + +this.__defineSetter__("x", function(){}); + +if (typeof gczeal == 'function') +{ + gczeal(0); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-454704.js b/js/src/tests/js1_5/extensions/regress-454704.js new file mode 100644 index 000000000..e9339e4b9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-454704.js @@ -0,0 +1,54 @@ +/* -*- 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 = 454704; +var summary = 'Do not crash with defineGetter and XPC wrapper'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof XPCSafeJSObjectWrapper != 'undefined' && typeof document != 'undefined') + { + gDelayTestDriverEnd = true; + document.addEventListener('load', boom, true); + } + else + { + print(expect = actual = 'Test requires browser.'); + reportCompare(expect, actual, summary); + } + exitFunc ('test'); +} + +function boom() +{ + try + { + var a = []; + g = []; + g.__defineGetter__("f", g.toSource); + a[0] = g; + a[1] = XPCSafeJSObjectWrapper(a); + print("" + a); + } + catch(ex) + { + } + gDelayTestDriverEnd = false; + jsTestDriverEnd(); + reportCompare(expect, actual, summary); +} + diff --git a/js/src/tests/js1_5/extensions/regress-455380.js b/js/src/tests/js1_5/extensions/regress-455380.js new file mode 100644 index 000000000..f0405621d --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-455380.js @@ -0,0 +1,60 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + * Contributor: Robert Sayre + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 455380; +var summary = 'Do not assert with JIT: !lhs->isQuad() && !rhs->isQuad()'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +const IS_TOKEN_ARRAY = + [0, 0, 0, 0, 0, 0, 0, 0, // 0 + 0, 0, 0, 0, 0, 0, 0, 0, // 8 + 0, 0, 0, 0, 0, 0, 0, 0, // 16 + 0, 0, 0, 0, 0, 0, 0, 0, // 24 + + 0, 1, 0, 1, 1, 1, 1, 1, // 32 + 0, 0, 1, 1, 0, 1, 1, 0, // 40 + 1, 1, 1, 1, 1, 1, 1, 1, // 48 + 1, 1, 0, 0, 0, 0, 0, 0, // 56 + + 0, 1, 1, 1, 1, 1, 1, 1, // 64 + 1, 1, 1, 1, 1, 1, 1, 1, // 72 + 1, 1, 1, 1, 1, 1, 1, 1, // 80 + 1, 1, 1, 0, 0, 0, 1, 1, // 88 + + 1, 1, 1, 1, 1, 1, 1, 1, // 96 + 1, 1, 1, 1, 1, 1, 1, 1, // 104 + 1, 1, 1, 1, 1, 1, 1, 1, // 112 + 1, 1, 1, 0, 1, 0, 1]; // 120 + +const headerUtils = { +normalizeFieldName: function(fieldName) +{ + if (fieldName == "") + throw "error: empty string"; + + for (var i = 0, sz = fieldName.length; i < sz; i++) + { + if (!IS_TOKEN_ARRAY[fieldName.charCodeAt(i)]) + { + throw (fieldName + " is not a valid header field name!"); + } + } + + return fieldName.toLowerCase(); +} +}; + +headerUtils.normalizeFieldName("Host"); + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-455408.js b/js/src/tests/js1_5/extensions/regress-455408.js new file mode 100644 index 000000000..358f6ed5b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-455408.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 = 455408; +var summary = 'Do not assert with JIT: "Should not move data from GPR to XMM": false'; +var actual = 'No Crash'; +var expect = 'No Crash'; + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + for (var j = 0; j < 5; ++j) { if (({}).__proto__ = 1) { } } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-455413.js b/js/src/tests/js1_5/extensions/regress-455413.js new file mode 100644 index 000000000..d00ab135b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-455413.js @@ -0,0 +1,24 @@ +/* -*- 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 = 455413; +var summary = 'Do not assert with JIT: (m != JSVAL_INT) || isInt32(*vp)'; +var actual = 'No Crash'; +var expect = 'No Crash'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +this.watch('x', Math.pow); (function() { for(var j=0;j<4;++j){x=1;} })(); + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-459606.js b/js/src/tests/js1_5/extensions/regress-459606.js new file mode 100644 index 000000000..926e1eead --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-459606.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 = 459606; +var summary = '((0.1).toFixed()).toSource()'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '(new String("0"))'; + actual = ((0.1).toFixed()).toSource(); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-462734-02.js b/js/src/tests/js1_5/extensions/regress-462734-02.js new file mode 100644 index 000000000..f7ccb5977 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-462734-02.js @@ -0,0 +1,26 @@ +/* -*- 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 = 462734; +var summary = 'Do not assert: pobj_ == obj2'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +try +{ + for (x in function(){}) ([]); + this.__defineGetter__("x", Function); + var obj = Object.create(x); + obj.prototype += []; +} +catch(ex) +{ +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-462734-03.js b/js/src/tests/js1_5/extensions/regress-462734-03.js new file mode 100644 index 000000000..c350154fc --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-462734-03.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 = 462734; +var summary = 'Do not assert: pobj_ == obj2'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +try +{ + Function.prototype.prototype; + var obj = Object.create(Function()); + obj.prototype = obj.prototype; +} +catch(ex) +{ +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-462734-04.js b/js/src/tests/js1_5/extensions/regress-462734-04.js new file mode 100644 index 000000000..a7fbe8f07 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-462734-04.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 = 462734; +var summary = 'Do not assert: pobj_ == obj2'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +var obj; +try +{ + Function.prototype.prototype = function() { return 42; } + obj = Object.create(Function()); + obj.prototype = obj.prototype; +} +catch(ex) +{ +} + +expect = 'object'; +actual = typeof obj.prototype; + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-465145.js b/js/src/tests/js1_5/extensions/regress-465145.js new file mode 100644 index 000000000..84f81703b --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-465145.js @@ -0,0 +1,24 @@ +/* -*- 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 = 465145; +var summary = 'Do not crash with watched defined setter'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +this.__defineSetter__("x", function(){}); +this.watch("x", function(){}); +y = this; +for (var z = 0; z < 2; ++z) { x = y }; +this.__defineSetter__("x", function(){}); +for (var z = 0; z < 2; ++z) { x = y }; + + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-465276.js b/js/src/tests/js1_5/extensions/regress-465276.js new file mode 100644 index 000000000..960590d74 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-465276.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 = 465276; +var summary = '((1 * (1))|""'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + expect = '[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]'; + empty = []; + out = []; + for (var j=0;j<10;++j) { empty[42]; out.push((1 * (1)) | ""); } + print(actual = uneval(out)); + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-469625.js b/js/src/tests/js1_5/extensions/regress-469625.js new file mode 100644 index 000000000..fef1c0e12 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-469625.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 = 469625; +var summary = 'TM: Do not crash @ js_String_getelem'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + [].__proto__[0] = 'a'; + for (var j = 0; j < 3; ++j) [[, ]] = [,]; + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-469761.js b/js/src/tests/js1_5/extensions/regress-469761.js new file mode 100644 index 000000000..c5c9cd9d7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-469761.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 = 469761; +var summary = 'TM: Do not assert: STOBJ_GET_SLOT(callee_obj, JSSLOT_PRIVATE).isInt32()'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + var o = { __proto__: function(){} }; + for (var j = 0; j < 3; ++j) { try { o.call(3); } catch (e) { } } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-472599.js b/js/src/tests/js1_5/extensions/regress-472599.js new file mode 100644 index 000000000..4cc260fd9 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-472599.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 = 472599; +var summary = 'Do not assert: STOBJ_GET_SLOT(callee_obj, JSSLOT_PRIVATE).isInt32()'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + var a = (function(){}).prototype; + a.__proto__ = a.toString; + for (var i = 0; i < 4; ++i) { try{ a.call({}); } catch(e) { } } + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-472787.js b/js/src/tests/js1_5/extensions/regress-472787.js new file mode 100755 index 000000000..d3196f05f --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-472787.js @@ -0,0 +1,31 @@ +// |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 = 472787; +var summary = 'Do not hang with gczeal, watch and concat'; +var actual = ''; +var expect = ''; + +printBugNumber(BUGNUMBER); +printStatus (summary); + +this.__defineSetter__("x", Math.sin); +this.watch("x", '' .concat); + +if (typeof gczeal == 'function') +{ + gczeal(2); +} + +x = 1; + +if (typeof gczeal == 'function') +{ + gczeal(0); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-476447.js b/js/src/tests/js1_5/extensions/regress-476447.js new file mode 100644 index 000000000..5590445c4 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-476447.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 = 476447; +var summary = 'Array getter/setter'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + Array.prototype.__defineGetter__('lastElement',(function() { return this[this.length-1]})); + Array.prototype.__defineSetter__('lastElement',(function(num){this[this.length-1]=num})); + var testArr=[1,2,3,4]; + + expect = 4; + actual = testArr.lastElement; + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-479487.js b/js/src/tests/js1_5/extensions/regress-479487.js new file mode 100644 index 000000000..a5d143f2e --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-479487.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 = 479487; +var summary = 'js_Array_dense_setelem can call arbitrary JS code'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + + Array.prototype[1] = 2; + + Array.prototype.__defineSetter__(32, function() { print("Hello from arbitrary JS");}); + Array.prototype.__defineGetter__(32, function() { return 11; }); + + function f() + { + var a = []; + for (var i = 0; i != 10; ++i) { + a[1 << i] = 9999; + } + return a; + } + + f(); + + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-479551.js b/js/src/tests/js1_5/extensions/regress-479551.js new file mode 100644 index 000000000..703ea5b9a --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-479551.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 = 479551; +var summary = 'Do not assert: (cx)->requestDepth || (cx)->thread == (cx)->runtime->gcThread'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof shapeOf != 'function') + { + print(expect = actual = 'Test skipped: requires shell'); + } + else + { + + var o = {a:3, b:2}; + shapeOf(o); + var p = {}; + p.a =3; + p.b=2; + shapeOf(p); + + + } + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-480579.js b/js/src/tests/js1_5/extensions/regress-480579.js new file mode 100644 index 000000000..5f3295f18 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-480579.js @@ -0,0 +1,38 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + * Contributor: Jason Orendorff + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 480579; +var summary = 'Do not assert: pobj_ == obj2'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '12'; + + a = {x: 1}; + b = {__proto__: a}; + c = {__proto__: b}; + for (i = 0; i < 2; i++) { + print(actual += c.x); + b.x = 2; + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-481516.js b/js/src/tests/js1_5/extensions/regress-481516.js new file mode 100644 index 000000000..ab2c257c6 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-481516.js @@ -0,0 +1,41 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + * Contributor: Jason Orendorff + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 481516; +var summary = 'TM: pobj_ == obj2'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + expect = '1111222'; + + a = {x: 1}; + b = {__proto__: a}; + c = {__proto__: b}; + objs = [{__proto__: a}, {__proto__: a}, {__proto__: a}, b, {__proto__: a}, + {__proto__: a}]; + for (i = 0; i < 6; i++) { + print(actual += ""+c.x); + objs[i].x = 2; + } + print(actual += c.x); + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-488995.js b/js/src/tests/js1_5/extensions/regress-488995.js new file mode 100644 index 000000000..f7abbe439 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-488995.js @@ -0,0 +1,46 @@ +/* -*- 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 = 488995; +var summary = 'Do not crash with watch, __defineSetter__ on svg'; +var actual = ''; +var expect = ''; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + if (typeof document == 'undefined') + { + print('Test skipped: requires browser.'); + } + else + { + try + { + var o=document.createElementNS("http://www.w3.org/2000/svg", "svg"); + var p=o.y; + p.watch('animVal', function(id, oldvar, newval) {} ); + p.type='xxx'; + p.__defineSetter__('animVal', function() {}); + p.animVal=0; + } + catch(ex) + { + } + } + + reportCompare(expect, actual, summary); + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-50447-1.js b/js/src/tests/js1_5/extensions/regress-50447-1.js new file mode 100644 index 000000000..688692b09 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-50447-1.js @@ -0,0 +1,173 @@ +/* -*- tab-width: 8; indent-tabs-mode: nil; js-indent-level: 4 -*- + * vim: set ts=8 sts=4 et sw=4 tw=99: + * 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/. */ + + +/* + * SUMMARY: New properties fileName, lineNumber have been added to Error objects + * in SpiderMonkey. These are non-ECMA extensions and do not exist in Rhino. + * + * See http://bugzilla.mozilla.org/show_bug.cgi?id=50447 + * + * 2005-04-05 Modified by bclary to support changes to error reporting + * which set default values for the error's fileName and + * lineNumber properties. + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 50447; +var summary = 'Test (non-ECMA) Error object properties fileName, lineNumber'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + testRealError(); + test1(); + test2(); + test3(); + test4(); + + exitFunc('test'); +} + +// Normalize filenames so this test can work on Windows. This +// function is also used on strings that contain filenames. +function normalize(filename) +{ + // Also convert double-backslash to single-slash to handle + // escaped filenames in string literals. + return filename.replace(/\\{1,2}/g, '/'); +} + +function testRealError() +{ + /* throw a real error, and see what it looks like */ + enterFunc ("testRealError"); + + try + { + blabla; + } + catch (e) + { + if (e.fileName.search (/-50447-1\.js$/i) == -1) + reportCompare('PASS', 'FAIL', "expected fileName to end with '-50447-1.js'"); + + reportCompare(60, e.lineNumber, + "lineNumber property returned unexpected value."); + } + + exitFunc ("testRealError"); +} + + +function test1() +{ + /* generate an error with msg, file, and lineno properties */ + enterFunc ("test1"); + + var e = new InternalError ("msg", "file", 2); + reportCompare ("(new InternalError(\"msg\", \"file\", 2))", + e.toSource(), + "toSource() returned unexpected result."); + reportCompare ("file", e.fileName, + "fileName property returned unexpected value."); + reportCompare (2, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test1"); +} + + +function test2() +{ + /* generate an error with only msg property */ + enterFunc ("test2"); + + /* note this test incorporates the path to the + test file and assumes the path to the test case + is a subdirectory of the directory containing jsDriver.pl + */ + var expectedLine = 109; + var expectedFileName = 'js1_5/extensions/regress-50447-1.js'; + if (typeof document != "undefined") { + expectedFileName = document.location.href. + replace(/[^\/]*(\?.*)$/, '') + + expectedFileName; + } + var e = new InternalError ("msg"); + reportCompare ("(new InternalError(\"msg\", \"" + + expectedFileName + "\", " + expectedLine + "))", + normalize(e.toSource()), + "toSource() returned unexpected result."); + reportCompare (expectedFileName, normalize(e.fileName), + "fileName property returned unexpected value."); + reportCompare (expectedLine, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test2"); +} + + +function test3() +{ + /* generate an error with only msg and lineNo properties */ + + /* note this test incorporates the path to the + test file and assumes the path to the test case + is a subdirectory of the directory containing jsDriver.pl + */ + + enterFunc ("test3"); + + var expectedFileName = 'js1_5/extensions/regress-50447-1.js'; + if (typeof document != "undefined") { + expectedFileName = document.location.href. + replace(/[^\/]*(\?.*)$/, '') + + expectedFileName; + } + + var e = new InternalError ("msg"); + e.lineNumber = 10; + reportCompare ("(new InternalError(\"msg\", \"" + + expectedFileName + "\", 10))", + normalize(e.toSource()), + "toSource() returned unexpected result."); + reportCompare (expectedFileName, normalize(e.fileName), + "fileName property returned unexpected value."); + reportCompare (10, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test3"); +} + + +function test4() +{ + /* generate an error with only msg and filename properties */ + enterFunc ("test4"); + + var expectedLine = 163; + + var e = new InternalError ("msg", "file"); + reportCompare ("(new InternalError(\"msg\", \"file\", " + expectedLine + "))", + e.toSource(), + "toSource() returned unexpected result."); + reportCompare ("file", e.fileName, + "fileName property returned unexpected value."); + reportCompare (expectedLine, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test4"); +} diff --git a/js/src/tests/js1_5/extensions/regress-50447.js b/js/src/tests/js1_5/extensions/regress-50447.js new file mode 100644 index 000000000..32044a8ed --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-50447.js @@ -0,0 +1,134 @@ +// |reftest| skip -- obsolete test +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * 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/. */ + + +/* + * SUMMARY: New properties fileName, lineNumber have been added to Error objects + * in SpiderMonkey. These are non-ECMA extensions and do not exist in Rhino. + * + * See http://bugzilla.mozilla.org/show_bug.cgi?id=50447 + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 50447; +var summary = 'Test (non-ECMA) Error object properties fileName, lineNumber'; + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + testRealError(); + test1(); + test2(); + test3(); + test4(); + + exitFunc('test'); +} + + +function testRealError() +{ + /* throw a real error, and see what it looks like */ + enterFunc ("testRealError"); + + try + { + blabla; + } + catch (e) + { + if (e.fileName.search (/-50447\.js$/i) == -1) + reportCompare('PASS', 'FAIL', + "expected fileName to end with '-50447.js'"); + + reportCompare (83, e.lineNumber, + "lineNumber property returned unexpected value."); + } + + exitFunc ("testRealError"); +} + + +function test1() +{ + /* generate an error with msg, file, and lineno properties */ + enterFunc ("test1"); + + var e = new InternalError ("msg", "file", 2); + reportCompare ("(new InternalError(\"msg\", \"file\", 2))", + e.toSource(), + "toSource() returned unexpected result."); + reportCompare ("file", e.fileName, + "fileName property returned unexpected value."); + reportCompare (2, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test1"); +} + + +function test2() +{ + /* generate an error with only msg property */ + enterFunc ("test2"); + + var e = new InternalError ("msg"); + reportCompare ("(new InternalError(\"msg\", \"\"))", + e.toSource(), + "toSource() returned unexpected result."); + reportCompare ("", e.fileName, + "fileName property returned unexpected value."); + reportCompare (0, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test2"); +} + + +function test3() +{ + /* generate an error with only msg and lineNo properties */ + enterFunc ("test3"); + + var e = new InternalError ("msg"); + e.lineNumber = 10; + reportCompare ("(new InternalError(\"msg\", \"\", 10))", + e.toSource(), + "toSource() returned unexpected result."); + reportCompare ("", e.fileName, + "fileName property returned unexpected value."); + reportCompare (10, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test3"); +} + + +function test4() +{ + /* generate an error with only msg and filename properties */ + enterFunc ("test4"); + + var e = new InternalError ("msg", "file"); + reportCompare ("(new InternalError(\"msg\", \"file\"))", + e.toSource(), + "toSource() returned unexpected result."); + reportCompare ("file", e.fileName, + "fileName property returned unexpected value."); + reportCompare (0, e.lineNumber, + "lineNumber property returned unexpected value."); + + exitFunc ("test4"); +} diff --git a/js/src/tests/js1_5/extensions/regress-543839.js b/js/src/tests/js1_5/extensions/regress-543839.js new file mode 100644 index 000000000..ce968bfba --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-543839.js @@ -0,0 +1,36 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + * Contributor: Igor Bukanov + */ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 543839; +var summary = 'js_GetMutableScope caller must lock the object'; +var actual; +var expect = 1; + +printBugNumber(BUGNUMBER); +printStatus (summary); + + +function test() +{ + for (var i = 0; i != 100; ++i) + var tmp = { a: 1 }; + return 1; +} + +if (typeof evalcx == 'undefined') +{ + print('Skipping. This test requires evalcx.'); + actual = expect; +} else { + test(); + test(); + test(); + actual = evalcx("test()", this); +} + +reportCompare(expect, actual, summary); diff --git a/js/src/tests/js1_5/extensions/regress-90596-001.js b/js/src/tests/js1_5/extensions/regress-90596-001.js new file mode 100644 index 000000000..9813b31d7 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-90596-001.js @@ -0,0 +1,265 @@ +/* -*- 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/. */ + +/* + * Date: 28 August 2001 + * + * SUMMARY: A [DontEnum] prop, if overridden, should appear in toSource(). + * See http://bugzilla.mozilla.org/show_bug.cgi?id=90596 + * + * NOTE: some inefficiencies in the test are made for the sake of readability. + * Sorting properties alphabetically is done for definiteness in comparisons. + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 90596; +var summary = 'A [DontEnum] prop, if overridden, should appear in toSource()'; +var cnCOMMA = ','; +var cnLBRACE = '{'; +var cnRBRACE = '}'; +var cnLPAREN = '('; +var cnRPAREN = ')'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; +var obj = {}; + + +status = inSection(1); +obj = {toString:9}; +actual = obj.toSource(); +expect = '({toString:9})'; +addThis(); + +status = inSection(2); +obj = {hasOwnProperty:"Hi"}; +actual = obj.toSource(); +expect = '({hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(3); +obj = {toString:9, hasOwnProperty:"Hi"}; +actual = obj.toSource(); +expect = '({toString:9, hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(4); +obj = {prop1:1, toString:9, hasOwnProperty:"Hi"}; +actual = obj.toSource(); +expect = '({prop1:1, toString:9, hasOwnProperty:"Hi"})'; +addThis(); + + +// TRY THE SAME THING IN EVAL CODE +var s = ''; + +status = inSection(5); +s = 'obj = {toString:9}'; +eval(s); +actual = obj.toSource(); +expect = '({toString:9})'; +addThis(); + +status = inSection(6); +s = 'obj = {hasOwnProperty:"Hi"}'; +eval(s); +actual = obj.toSource(); +expect = '({hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(7); +s = 'obj = {toString:9, hasOwnProperty:"Hi"}'; +eval(s); +actual = obj.toSource(); +expect = '({toString:9, hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(8); +s = 'obj = {prop1:1, toString:9, hasOwnProperty:"Hi"}'; +eval(s); +actual = obj.toSource(); +expect = '({prop1:1, toString:9, hasOwnProperty:"Hi"})'; +addThis(); + + +// TRY THE SAME THING IN FUNCTION CODE +function A() +{ + status = inSection(9); + var s = 'obj = {toString:9}'; + eval(s); + actual = obj.toSource(); + expect = '({toString:9})'; + addThis(); +} +A(); + +function B() +{ + status = inSection(10); + var s = 'obj = {hasOwnProperty:"Hi"}'; + eval(s); + actual = obj.toSource(); + expect = '({hasOwnProperty:"Hi"})'; + addThis(); +} +B(); + +function C() +{ + status = inSection(11); + var s = 'obj = {toString:9, hasOwnProperty:"Hi"}'; + eval(s); + actual = obj.toSource(); + expect = '({toString:9, hasOwnProperty:"Hi"})'; + addThis(); +} +C(); + +function D() +{ + status = inSection(12); + var s = 'obj = {prop1:1, toString:9, hasOwnProperty:"Hi"}'; + eval(s); + actual = obj.toSource(); + expect = '({prop1:1, toString:9, hasOwnProperty:"Hi"})'; + addThis(); +} +D(); + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + + +/* + * Sort properties alphabetically - + */ +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = sortThis(actual); + expectedvalues[UBound] = sortThis(expect); + UBound++; +} + + +/* + * Takes string of form '({"c", "b", "a", 2})' and returns '({"a","b","c",2})' + */ +function sortThis(sList) +{ + sList = compactThis(sList); + sList = stripParens(sList); + sList = stripBraces(sList); + var arr = sList.split(cnCOMMA); + arr = arr.sort(); + var ret = String(arr); + ret = addBraces(ret); + ret = addParens(ret); + return ret; +} + + +/* + * Strips out any whitespace from the text - + */ +function compactThis(text) +{ + var charCode = 0; + var ret = ''; + + for (var i=0; i<text.length; i++) + { + charCode = text.charCodeAt(i); + + if (!isWhiteSpace(charCode)) + ret += text.charAt(i); + } + + return ret; +} + + +function isWhiteSpace(charCode) +{ + switch (charCode) + { + case (0x0009): + case (0x000B): + case (0x000C): + case (0x0020): + case (0x000A): // '\n' + case (0x000D): // '\r' + return true; + break; + + default: + return false; + } +} + + +/* + * strips off parens at beginning and end of text - + */ +function stripParens(text) +{ + // remember to escape the parens... + var arr = text.match(/^\((.*)\)$/); + + // defend against a null match... + if (arr != null && arr[1] != null) + return arr[1]; + return text; +} + + +/* + * strips off braces at beginning and end of text - + */ +function stripBraces(text) +{ + // remember to escape the braces... + var arr = text.match(/^\{(.*)\}$/); + + // defend against a null match... + if (arr != null && arr[1] != null) + return arr[1]; + return text; +} + + +function addBraces(text) +{ + return cnLBRACE + text + cnRBRACE; +} + + +function addParens(text) +{ + return cnLPAREN + text + cnRPAREN; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-90596-002.js b/js/src/tests/js1_5/extensions/regress-90596-002.js new file mode 100644 index 000000000..ccd267a11 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-90596-002.js @@ -0,0 +1,265 @@ +/* -*- 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/. */ + +/* + * Date: 28 August 2001 + * + * SUMMARY: A [DontEnum] prop, if overridden, should appear in uneval(). + * See http://bugzilla.mozilla.org/show_bug.cgi?id=90596 + * + * NOTE: some inefficiencies in the test are made for the sake of readability. + * Sorting properties alphabetically is done for definiteness in comparisons. + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 90596; +var summary = 'A [DontEnum] prop, if overridden, should appear in uneval()'; +var cnCOMMA = ','; +var cnLBRACE = '{'; +var cnRBRACE = '}'; +var cnLPAREN = '('; +var cnRPAREN = ')'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; +var obj = {}; + + +status = inSection(1); +obj = {toString:9}; +actual = uneval(obj); +expect = '({toString:9})'; +addThis(); + +status = inSection(2); +obj = {hasOwnProperty:"Hi"}; +actual = uneval(obj); +expect = '({hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(3); +obj = {toString:9, hasOwnProperty:"Hi"}; +actual = uneval(obj); +expect = '({toString:9, hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(4); +obj = {prop1:1, toString:9, hasOwnProperty:"Hi"}; +actual = uneval(obj); +expect = '({prop1:1, toString:9, hasOwnProperty:"Hi"})'; +addThis(); + + +// TRY THE SAME THING IN EVAL CODE +var s = ''; + +status = inSection(5); +s = 'obj = {toString:9}'; +eval(s); +actual = uneval(obj); +expect = '({toString:9})'; +addThis(); + +status = inSection(6); +s = 'obj = {hasOwnProperty:"Hi"}'; +eval(s); +actual = uneval(obj); +expect = '({hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(7); +s = 'obj = {toString:9, hasOwnProperty:"Hi"}'; +eval(s); +actual = uneval(obj); +expect = '({toString:9, hasOwnProperty:"Hi"})'; +addThis(); + +status = inSection(8); +s = 'obj = {prop1:1, toString:9, hasOwnProperty:"Hi"}'; +eval(s); +actual = uneval(obj); +expect = '({prop1:1, toString:9, hasOwnProperty:"Hi"})'; +addThis(); + + +// TRY THE SAME THING IN FUNCTION CODE +function A() +{ + status = inSection(9); + var s = 'obj = {toString:9}'; + eval(s); + actual = uneval(obj); + expect = '({toString:9})'; + addThis(); +} +A(); + +function B() +{ + status = inSection(10); + var s = 'obj = {hasOwnProperty:"Hi"}'; + eval(s); + actual = uneval(obj); + expect = '({hasOwnProperty:"Hi"})'; + addThis(); +} +B(); + +function C() +{ + status = inSection(11); + var s = 'obj = {toString:9, hasOwnProperty:"Hi"}'; + eval(s); + actual = uneval(obj); + expect = '({toString:9, hasOwnProperty:"Hi"})'; + addThis(); +} +C(); + +function D() +{ + status = inSection(12); + var s = 'obj = {prop1:1, toString:9, hasOwnProperty:"Hi"}'; + eval(s); + actual = uneval(obj); + expect = '({prop1:1, toString:9, hasOwnProperty:"Hi"})'; + addThis(); +} +D(); + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + + +/* + * Sort properties alphabetically - + */ +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = sortThis(actual); + expectedvalues[UBound] = sortThis(expect); + UBound++; +} + + +/* + * Takes string of form '({"c", "b", "a", 2})' and returns '({"a","b","c",2})' + */ +function sortThis(sList) +{ + sList = compactThis(sList); + sList = stripParens(sList); + sList = stripBraces(sList); + var arr = sList.split(cnCOMMA); + arr = arr.sort(); + var ret = String(arr); + ret = addBraces(ret); + ret = addParens(ret); + return ret; +} + + +/* + * Strips out any whitespace from the text - + */ +function compactThis(text) +{ + var charCode = 0; + var ret = ''; + + for (var i=0; i<text.length; i++) + { + charCode = text.charCodeAt(i); + + if (!isWhiteSpace(charCode)) + ret += text.charAt(i); + } + + return ret; +} + + +function isWhiteSpace(charCode) +{ + switch (charCode) + { + case (0x0009): + case (0x000B): + case (0x000C): + case (0x0020): + case (0x000A): // '\n' + case (0x000D): // '\r' + return true; + break; + + default: + return false; + } +} + + +/* + * strips off parens at beginning and end of text - + */ +function stripParens(text) +{ + // remember to escape the parens... + var arr = text.match(/^\((.*)\)$/); + + // defend against a null match... + if (arr != null && arr[1] != null) + return arr[1]; + return text; +} + + +/* + * strips off braces at beginning and end of text - + */ +function stripBraces(text) +{ + // remember to escape the braces... + var arr = text.match(/^\{(.*)\}$/); + + // defend against a null match... + if (arr != null && arr[1] != null) + return arr[1]; + return text; +} + + +function addBraces(text) +{ + return cnLBRACE + text + cnRBRACE; +} + + +function addParens(text) +{ + return cnLPAREN + text + cnRPAREN; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i=0; i<UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-96284-001.js b/js/src/tests/js1_5/extensions/regress-96284-001.js new file mode 100644 index 000000000..64a21f0e0 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-96284-001.js @@ -0,0 +1,148 @@ +/* -*- 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/. */ + +/* + * Date: 03 September 2001 + * + * SUMMARY: Double quotes should be escaped in Error.prototype.toSource() + * See http://bugzilla.mozilla.org/show_bug.cgi?id=96284 + * + * The real point here is this: we should be able to reconstruct an object + * from its toSource() property. We'll test this on various types of objects. + * + * Method: define obj2 = eval(obj1.toSource()) and verify that + * obj2.toSource() == obj1.toSource(). + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 96284; +var summary = 'Double quotes should be escaped in Error.prototype.toSource()'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; +var obj1 = {}; +var obj2 = {}; +var cnTestString = '"This is a \" STUPID \" test string!!!"\\'; + + +// various NativeError objects - +status = inSection(1); +obj1 = Error(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(2); +obj1 = EvalError(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(3); +obj1 = RangeError(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(4); +obj1 = ReferenceError(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(5); +obj1 = SyntaxError(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(6); +obj1 = TypeError(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(7); +obj1 = URIError(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + + +// other types of objects - +status = inSection(8); +obj1 = new String(cnTestString); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(9); +obj1 = {color:'red', texture:cnTestString, hasOwnProperty:42}; +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(10); +obj1 = function(x) {function g(y){return y+1;} return g(x);}; +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(11); +obj1 = new Number(eval('6')); +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(12); +obj1 = /ad;(lf)kj(2309\/\/)\/\//; +obj2 = eval(obj1.toSource()); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/regress-96284-002.js b/js/src/tests/js1_5/extensions/regress-96284-002.js new file mode 100644 index 000000000..7cecd2645 --- /dev/null +++ b/js/src/tests/js1_5/extensions/regress-96284-002.js @@ -0,0 +1,148 @@ +/* -*- 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/. */ + +/* + * Date: 03 September 2001 + * + * SUMMARY: Double quotes should be escaped in uneval(new Error('""')) + * See http://bugzilla.mozilla.org/show_bug.cgi?id=96284 + * + * The real point here is this: we should be able to reconstruct an object + * obj from uneval(obj). We'll test this on various types of objects. + * + * Method: define obj2 = eval(uneval(obj1)) and verify that + * obj2.toSource() == obj1.toSource(). + */ +//----------------------------------------------------------------------------- +var UBound = 0; +var BUGNUMBER = 96284; +var summary = 'Double quotes should be escaped in Error.prototype.toSource()'; +var status = ''; +var statusitems = []; +var actual = ''; +var actualvalues = []; +var expect= ''; +var expectedvalues = []; +var obj1 = {}; +var obj2 = {}; +var cnTestString = '"This is a \" STUPID \" test string!!!"\\'; + + +// various NativeError objects - +status = inSection(1); +obj1 = Error(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(2); +obj1 = EvalError(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(3); +obj1 = RangeError(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(4); +obj1 = ReferenceError(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(5); +obj1 = SyntaxError(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(6); +obj1 = TypeError(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(7); +obj1 = URIError(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + + +// other types of objects - +status = inSection(8); +obj1 = new String(cnTestString); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(9); +obj1 = {color:'red', texture:cnTestString, hasOwnProperty:42}; +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(10); +obj1 = function(x) {function g(y){return y+1;} return g(x);}; +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(11); +obj1 = new Number(eval('6')); +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + +status = inSection(12); +obj1 = /ad;(lf)kj(2309\/\/)\/\//; +obj2 = eval(uneval(obj1)); +actual = obj2.toSource(); +expect = obj1.toSource(); +addThis(); + + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +function addThis() +{ + statusitems[UBound] = status; + actualvalues[UBound] = actual; + expectedvalues[UBound] = expect; + UBound++; +} + + +function test() +{ + enterFunc ('test'); + printBugNumber(BUGNUMBER); + printStatus (summary); + + for (var i = 0; i < UBound; i++) + { + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); + } + + exitFunc ('test'); +} diff --git a/js/src/tests/js1_5/extensions/scope-001.js b/js/src/tests/js1_5/extensions/scope-001.js new file mode 100644 index 000000000..b1982126a --- /dev/null +++ b/js/src/tests/js1_5/extensions/scope-001.js @@ -0,0 +1,88 @@ +/* -*- 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 = '53268'; +var status = 'Testing scope after changing obj.__proto__'; +var expect= ''; +var actual = ''; +var obj = {}; + +Object.defineProperty(this, "five", { + value: 5, + enumerable: true, + writable: false +}); + + +//----------------------------------------------------------------------------- +test(); +//----------------------------------------------------------------------------- + + +function test() +{ + enterFunc ("test"); + printBugNumber(BUGNUMBER); + printStatus (status); + + + status= 'Step 1: setting obj.__proto__ = global object'; + obj.__proto__ = this; + + actual = obj.five; + expect=5; + reportCompare (expect, actual, status); + + obj.five=1; + actual = obj.five; + expect=5; + reportCompare (expect, actual, status); + + + + status= 'Step 2: setting obj.__proto__ = null'; + obj.__proto__ = null; + + actual = obj.five; + expect=undefined; + reportCompare (expect, actual, status); + + obj.five=2; + actual = obj.five; + expect=2; + reportCompare (expect, actual, status); + + + + status= 'Step 3: setting obj.__proto__ to global object again'; + obj.__proto__ = this; + + actual = obj.five; + expect=2; //<--- (FROM STEP 2 ABOVE) + reportCompare (expect, actual, status); + + obj.five=3; + actual = obj.five; + expect=3; + reportCompare (expect, actual, status); + + + + status= 'Step 4: setting obj.__proto__ to null again'; + obj.__proto__ = null; + + actual = obj.five; + expect=3; //<--- (FROM STEP 3 ABOVE) + reportCompare (expect, actual, status); + + obj.five=4; + actual = obj.five; + expect=4; + reportCompare (expect, actual, status); + + + exitFunc ("test"); +} diff --git a/js/src/tests/js1_5/extensions/shell.js b/js/src/tests/js1_5/extensions/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/js1_5/extensions/shell.js diff --git a/js/src/tests/js1_5/extensions/toLocaleFormat-01.js b/js/src/tests/js1_5/extensions/toLocaleFormat-01.js new file mode 100644 index 000000000..02f269125 --- /dev/null +++ b/js/src/tests/js1_5/extensions/toLocaleFormat-01.js @@ -0,0 +1,230 @@ +/* -*- 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 = 291494; +var summary = 'Date.prototype.toLocaleFormat extension'; +var actual = ''; +var expect = ''; +var temp; + +/* + * SpiderMonkey only. + * + * When the output of toLocaleFormat exceeds 100 bytes toLocaleFormat + * defaults to using toString to produce the result. +*/ + +enterFunc ('test'); +printBugNumber(BUGNUMBER); +printStatus (summary); + +var date = new Date("06/05/2005 00:00:00 GMT-0000"); + +expect = date.getTimezoneOffset() > 0 ? 'Sat' : 'Sun'; +actual = date.toLocaleFormat('%a'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%a")'); + +expect = date.getTimezoneOffset() > 0 ? 'Saturday' : 'Sunday'; +actual = date.toLocaleFormat('%A'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%A")'); + +expect = 'Jun'; +actual = date.toLocaleFormat('%b'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%b")'); + +expect = 'June'; +actual = date.toLocaleFormat('%B'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%B")'); + +expect = (date.getTimezoneOffset() > 0) ? '04' : '05'; +actual = date.toLocaleFormat('%d'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%d")'); + +expect = '0'; +actual = String((Number(date.toLocaleFormat('%H')) + + date.getTimezoneOffset()/60) % 24); +reportCompare(expect, actual, 'Date.toLocaleFormat(%H)'); + +expect = '12'; +actual = String(Number(date.toLocaleFormat('%I')) + + date.getTimezoneOffset()/60); +reportCompare(expect, actual, 'Date.toLocaleFormat(%I)'); + +expect = String(155 + ((date.getTimezoneOffset() > 0) ? 0 : 1)); +actual = date.toLocaleFormat('%j'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%j")'); + +expect = '06'; +actual = date.toLocaleFormat('%m'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%m")'); + +expect = '00'; +actual = date.toLocaleFormat('%M'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%M")'); + +expect = true; +temp = date.toLocaleFormat('%p'); +actual = temp == 'AM' || date.toLocaleFormat('%p') == 'PM'; +reportCompare(expect, actual, 'Date.toLocaleFormat("%p") is AM or PM'); + +expect = '00'; +actual = date.toLocaleFormat('%S'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%S")'); + +expect = String(22 + ((date.getTimezoneOffset() > 0) ? 0 : 1)); +actual = date.toLocaleFormat('%U'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%U")'); + +expect = String((6 + ((date.getTimezoneOffset() > 0) ? 0 : 1))%7); +actual = date.toLocaleFormat('%w'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%w")'); + +expect = '22'; +actual = date.toLocaleFormat('%W'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%W")'); + +expect = '05'; +actual = date.toLocaleFormat('%y'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%y")'); + +expect = '2005'; +actual = date.toLocaleFormat('%Y'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%Y")'); + +expect = '%'; +actual = date.toLocaleFormat('%%'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%%")'); + + +expect = '1899 99'; +temp='%Y %y'; +actual = new Date(0, 0, 0, 13, 14, 15, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '1899189918991899189918991899189918991899189918991899189918991899189918991899189918991899'; +temp = '%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(0, 0, 0, 13, 14, 15, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = 'xxx189918991899189918991899189918991899189918991899189918991899189918991899189918991899189918991899'; +temp = 'xxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(0, 0, 0, 13, 14, 15, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = new Date(0, 0, 0, 13, 14, 15, 0).toString(); +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(0, 0, 0, 13, 14, 15, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = 'xxxx189918991899189918991899189918991899'; +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(0, 0, 0, 13, 14, 15, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + + +expect = '-51 49'; +temp = '%Y %y'; +actual = new Date(-51, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51'; +temp = '%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(-51, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = 'xxx-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51-51'; +temp = 'xxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(-51, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = new Date(-51, 0).toString(); +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(-51, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + + +expect = '1851 51'; +temp = '%Y %y'; +actual = new Date(1851, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '1851185118511851185118511851185118511851185118511851185118511851185118511851185118511851'; +temp = '%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(1851, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = 'xxx185118511851185118511851185118511851185118511851185118511851185118511851185118511851185118511851'; +temp = 'xxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(1851, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = new Date(1851, 0).toString(); +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(1851, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + + +expect = '-1 99'; +temp = '%Y %y'; +actual = new Date(-1, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '-100 00'; +temp = '%Y %y'; +actual = new Date(-100, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '1900 00'; +temp = '%Y %y'; +actual = new Date(0, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '1901 01'; +temp = '%Y %y'; +actual = new Date(1, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '1970 70'; +temp = '%Y %y'; +actual = new Date(1970, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + + +expect = new Date(32767, 0).toString(); +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(32767, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = '32767327673276732767327673276732767327673276732767327673276732767327673276732767327673276732767'; +temp = '%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(32767, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = 'xxxx32767327673276732767327673276732767327673276732767327673276732767327673276732767327673276732767'; +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(32767, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = new Date(32767, 0).toString(); +temp = 'xxxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(32767, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + + +expect = '-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999'; +temp = '%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(-9999, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = 'xxxx-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999-9999'; +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(-9999, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); + +expect = new Date(-9999, 0).toString(); +temp = 'xxxx%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y%Y'; +actual = new Date(-9999, 0).toLocaleFormat(temp); +reportCompare(expect, actual, 'Date.toLocaleFormat("'+temp+'")'); diff --git a/js/src/tests/js1_5/extensions/toLocaleFormat-02.js b/js/src/tests/js1_5/extensions/toLocaleFormat-02.js new file mode 100644 index 000000000..8fb87a0fc --- /dev/null +++ b/js/src/tests/js1_5/extensions/toLocaleFormat-02.js @@ -0,0 +1,105 @@ +// |reftest| fails-if(xulRuntime.OS=="WINNT") skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) +/* -*- 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 = 291494; +var summary = 'Date.prototype.toLocaleFormat extension'; +var actual = ''; +var expect = ''; +var temp; + +/* + * SpiderMonkey only. + * + * This test uses format strings which are not supported cross + * platform and are expected to fail on at least some platforms + * however they all currently pass on Linux (Fedora Core 6). They are + * included here in order to increase coverage for cases where a crash + * may occur. These failures will be tracked in the + * mozilla/js/tests/public-failures.txt list. + * + */ + +enterFunc ('test'); +printBugNumber(BUGNUMBER); +printStatus (summary); + +var date = new Date("06/05/2005 00:00:00 GMT-0000"); + +expect = '20'; +actual = date.toLocaleFormat('%C'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%C")'); + +expect = date.toLocaleFormat('%C%y'); +actual = date.toLocaleFormat('%Y'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%C%y") == ' + + 'Date.toLocaleFormat("%Y")'); + +expect = date.toLocaleFormat('%m/%d/%y'); +actual = date.toLocaleFormat('%D'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%m/%d/%y") == ' + + 'Date.toLocaleFormat("%D")'); + +expect = (date.getTimezoneOffset() > 0) ? ' 4' : ' 5'; +actual = date.toLocaleFormat('%e'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%e")'); + +expect = date.toLocaleFormat('%Y-%m-%d'); +actual = date.toLocaleFormat('%F'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%Y-%m-%d") == ' + + 'Date.toLocaleFormat("%F")'); + +expect = '05'; +actual = date.toLocaleFormat('%g'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%g")'); + +expect = '2005'; +actual = date.toLocaleFormat('%G'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%G")'); + +expect = date.toLocaleFormat('%b'); +actual = date.toLocaleFormat('%h'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%b") == ' + + 'Date.toLocaleFormat("%h")'); + +expect = '\n'; +actual = date.toLocaleFormat('%n'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%n") == "\\n"'); + +expect = date.toLocaleFormat('%I:%M:%S %p'); +actual = date.toLocaleFormat('%r'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%I:%M:%S %p") == ' + + 'Date.toLocaleFormat("%r")'); + +expect = date.toLocaleFormat('%H:%M'); +actual = date.toLocaleFormat('%R'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%H:%M") == ' + + 'Date.toLocaleFormat("%R")'); + +expect = '\t'; +actual = date.toLocaleFormat('%t'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%t") == "\\t"'); + +expect = date.toLocaleFormat('%H:%M:%S'); +actual = date.toLocaleFormat('%T'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%H:%M:%S") == ' + + 'Date.toLocaleFormat("%T")'); + +expect = String(6 + ((date.getTimezoneOffset() > 0) ? 0 : 1)); +actual = date.toLocaleFormat('%u'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%u")'); + +expect = '22'; +actual = date.toLocaleFormat('%V'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%V")'); + +print('Note: For Date.toLocaleFormat("%m/%d/%y") == Date.toLocaleFormat("%x") ' + + 'to pass in Windows, the Regional Setting for the short date must be ' + + 'set to mm/dd/yyyy'); +expect = date.toLocaleFormat('%m/%d/%Y'); +actual = date.toLocaleFormat('%x'); +reportCompare(expect, actual, 'Date.toLocaleFormat("%m/%d/%Y") == ' + + 'Date.toLocaleFormat("%x")'); |