diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/non262/Script | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/non262/Script')
-rw-r--r-- | js/src/tests/non262/Script/browser.js | 0 | ||||
-rw-r--r-- | js/src/tests/non262/Script/delete-001.js | 46 | ||||
-rw-r--r-- | js/src/tests/non262/Script/function-002.js | 42 | ||||
-rw-r--r-- | js/src/tests/non262/Script/in-001.js | 33 | ||||
-rw-r--r-- | js/src/tests/non262/Script/new-001.js | 79 | ||||
-rw-r--r-- | js/src/tests/non262/Script/shell.js | 0 | ||||
-rw-r--r-- | js/src/tests/non262/Script/switch-001.js | 48 |
7 files changed, 248 insertions, 0 deletions
diff --git a/js/src/tests/non262/Script/browser.js b/js/src/tests/non262/Script/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/non262/Script/browser.js diff --git a/js/src/tests/non262/Script/delete-001.js b/js/src/tests/non262/Script/delete-001.js new file mode 100644 index 0000000000..197a7c7277 --- /dev/null +++ b/js/src/tests/non262/Script/delete-001.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/. */ + + +/** + File Name: delete-001.js + Section: regress + Description: + + Regression test for + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=108736 + + Author: christine@netscape.com + Date: 12 november 1997 +*/ + +var SECTION = "JS1_2"; +var TITLE = "The variable statement"; + +writeHeaderToLog( SECTION + " "+ TITLE); + +// delete all properties of the global object +// per ecma, this does not affect variables in the global object declared +// with var or functions + +for ( p in this ) { + delete p; +} + +var result =""; + +for ( p in this ) { + result += String( p ); +} + +// not too picky here... just want to make sure we didn't crash or something + +new TestCase( "delete all properties of the global object", + "PASSED", + result == "" ? "FAILED" : "PASSED" ); + + +test(); + diff --git a/js/src/tests/non262/Script/function-002.js b/js/src/tests/non262/Script/function-002.js new file mode 100644 index 0000000000..ad99b6d5ef --- /dev/null +++ b/js/src/tests/non262/Script/function-002.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/. */ + + +/** + File Name: function-002.js + Section: + Description: + + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=249579 + + function definitions in conditional statements should be allowed. + + Author: christine@netscape.com + Date: 12 november 1997 +*/ +var SECTION = "function-002"; +var TITLE = "Regression test for 249579"; +var BUGNUMBER="249579"; + +printBugNumber(BUGNUMBER); +writeHeaderToLog( SECTION + " "+ TITLE); + +new TestCase( + "0?function(){}:0", + 0, + 0?function(){}:0 ); + + +bar = true; +foo = bar ? function () { return true; } : function() { return false; }; + +new TestCase( + "bar = true; foo = bar ? function () { return true; } : function() { return false; }; foo()", + true, + foo() ); + + +test(); + diff --git a/js/src/tests/non262/Script/in-001.js b/js/src/tests/non262/Script/in-001.js new file mode 100644 index 0000000000..dc7b68fa04 --- /dev/null +++ b/js/src/tests/non262/Script/in-001.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/. */ + + +/** + File Name: in-001.js + Section: + Description: + + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=196109 + + + Author: christine@netscape.com + Date: 12 november 1997 +*/ +var SECTION = "in-001"; +var TITLE = "Regression test for 196109"; +var BUGNUMBER="196109"; + +printBugNumber(BUGNUMBER); +writeHeaderToLog( SECTION + " "+ TITLE); + +o = {}; +o.foo = 'sil'; + +new TestCase( + "\"foo\" in o", + true, + "foo" in o ); + +test(); diff --git a/js/src/tests/non262/Script/new-001.js b/js/src/tests/non262/Script/new-001.js new file mode 100644 index 0000000000..e1ef060504 --- /dev/null +++ b/js/src/tests/non262/Script/new-001.js @@ -0,0 +1,79 @@ +/* -*- 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/. */ + + +/** + File Name: new-001.js + Section: + Description: + + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=76103 + + Author: christine@netscape.com + Date: 12 november 1997 +*/ +var SECTION = "new-001"; +var TITLE = "new-001"; +var BUGNUMBER="31567"; + +printBugNumber(BUGNUMBER); +writeHeaderToLog( SECTION + " "+ TITLE); + +function Test_One (x) { + this.v = x+1; + return x*2 + } + +function Test_Two( x, y ) { + this.v = x; + return y; +} + +new TestCase( + "Test_One(18)", + 36, + Test_One(18) ); + +new TestCase( + "new Test_One(18)", + "[object Object]", + new Test_One(18) +"" ); + +new TestCase( + "new Test_One(18).v", + 19, + new Test_One(18).v ); + +new TestCase( + "Test_Two(2,7)", + 7, + Test_Two(2,7) ); + +new TestCase( + "new Test_Two(2,7)", + "[object Object]", + new Test_Two(2,7) +"" ); + +new TestCase( + "new Test_Two(2,7).v", + 2, + new Test_Two(2,7).v ); + +new TestCase( + "new (Function)(\"x\", \"return x+3\")(5,6)", + 8, + new (Function)("x","return x+3")(5,6) ); + +new TestCase( + "new new Test_Two(String, 2).v(0123)", + "83", + new new Test_Two(String, 2).v(0123) +""); + +new TestCase( + "new new Test_Two(String, 2).v(0123).length", + 2, + new new Test_Two(String, 2).v(0123).length ); + +test(); diff --git a/js/src/tests/non262/Script/shell.js b/js/src/tests/non262/Script/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/non262/Script/shell.js diff --git a/js/src/tests/non262/Script/switch-001.js b/js/src/tests/non262/Script/switch-001.js new file mode 100644 index 0000000000..5642d0c1bf --- /dev/null +++ b/js/src/tests/non262/Script/switch-001.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/. */ + + +/** + File Name: switch-001.js + Section: + Description: + + http://scopus.mcom.com/bugsplat/show_bug.cgi?id=315767 + + Verify that switches do not use strict equality in + versions of JavaScript < 1.4 + + Author: christine@netscape.com + Date: 12 november 1997 +*/ +var SECTION = "switch-001"; +var TITLE = "switch-001"; +var BUGNUMBER="315767"; + +printBugNumber(BUGNUMBER); +writeHeaderToLog( SECTION + " "+ TITLE); + +result = "fail: did not enter switch"; + +switch (true) { +case 1: + result = "fail: for backwards compatibility, version 130 use strict equality"; + break; +case true: + result = "pass"; + break; +default: + result = "fail: evaluated default statement"; +} + +new TestCase( + "switch / case should use strict equality in version of JS < 1.4", + "pass", + result ); + + + +test(); + |