diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/types/undefined | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
10 files changed, 172 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A1_T1.js b/js/src/tests/test262/language/types/undefined/S8.1_A1_T1.js new file mode 100644 index 0000000000..b1d896cef5 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A1_T1.js @@ -0,0 +1,13 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Undefined type has one value, called undefined +es5id: 8.1_A1_T1 +description: Checking if execution of "var x = undefined" passes +---*/ + +// CHECK#1 +var x = undefined; + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A1_T2.js b/js/src/tests/test262/language/types/undefined/S8.1_A1_T2.js new file mode 100644 index 0000000000..a212e94285 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A1_T2.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The Undefined type has one value, called undefined +es5id: 8.1_A1_T2 +description: Check typeof(undefined) and typeof(void 0) +---*/ + +// CHECK#1 +if (!(typeof(undefined) === "undefined")) { + ERROR('#1: typeof(undefined) === "undefined". Actual: ' + (typeof(undefined))); +} + +// CHECK#2 +if (!(typeof(void 0) === "undefined")) { + ERROR('#2: typeof(void 0) === "undefined". Actual: ' + (typeof(void 0))); +} + +// CHECK#3 +if (!(undefined === void 0)) { + ERROR('#3: undefined === void 0'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A2_T1.js b/js/src/tests/test262/language/types/undefined/S8.1_A2_T1.js new file mode 100644 index 0000000000..979643fe26 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A2_T1.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Any variable that has not been assigned a value has the value undefined +es5id: 8.1_A2_T1 +description: Check that var x have value and type undefined +---*/ + +var x; + +/////////////////////////////////////////////////////////////////// +// CHECK#1 +if (!(x === undefined)) { + throw new Test262Error('#1: var x; x === undefined. Actual: ' + (x)); +} +// +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// CHECK#2 +if (!(typeof(x) === "undefined")) { + throw new Test262Error('#2: var x; typeof(x) === "undefined". Actual: ' + (typeof(x))); +} +// +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// CHECK#3 +if (!(x === void 0)) { + throw new Test262Error('#3: var x; x === void 0. Actual: ' + (x)); +} +// +/////////////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A2_T2.js b/js/src/tests/test262/language/types/undefined/S8.1_A2_T2.js new file mode 100644 index 0000000000..f764573a4e --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A2_T2.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Any variable that has not been assigned a value has the value undefined +es5id: 8.1_A2_T2 +description: Function return undefined +---*/ + +// CHECK#1 +function test1(x) { + return x; +} + +if (!(test1() === void 0)) { + throw new Test262Error('#1: function test1(x){return x} test1() === void 0. Actual: ' + (test1())); +} + +// CHECK#2 +function test2() { +} + +if (!(test2() === void 0)) { + throw new Test262Error('#2: function test2(){} test2() === void 0. Actual: ' + (test2())); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A3_T1.js b/js/src/tests/test262/language/types/undefined/S8.1_A3_T1.js new file mode 100644 index 0000000000..8df494237e --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A3_T1.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: undefined is not a keyword +es5id: 8.1_A3 +description: Create variable named undefined +---*/ + +////////////////////////////////////////////////////////// +// CHECK1# +var undefined; +// +////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A3_T2.js b/js/src/tests/test262/language/types/undefined/S8.1_A3_T2.js new file mode 100644 index 0000000000..c0003ac62f --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A3_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: undefined is not a keyword +es5id: 8.1_A3 +description: Create variable named undefined +flags: [noStrict] +---*/ + +////////////////////////////////////////////////////////// +// CHECK1# +var undefined = 1; +// +////////////////////////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A4.js b/js/src/tests/test262/language/types/undefined/S8.1_A4.js new file mode 100644 index 0000000000..53d3f74886 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A4.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: If property of object not exist, return undefined +es5id: 8.1_A4 +description: Check value of not existed property +---*/ + +// CHECK#1 +if ((new Object()).newProperty !== undefined) { + throw new Test262Error('#1: (new Object()).newProperty === undefined. Actual: ' + ((new Object()).newProperty)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/S8.1_A5.js b/js/src/tests/test262/language/types/undefined/S8.1_A5.js new file mode 100644 index 0000000000..8cc74ec664 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/S8.1_A5.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Function argument that isn't provided has a value of undefined +es5id: 8.1_A5 +description: Call function without provided argument +---*/ + +/////////////////////////////////////// +// +function test(arg) { +// Check and make sure that arg is not undefined + if (typeof(arg) !== "undefined") { + throw new Test262Error('#1: Function argument that isn\'t provided has a value of undefined. Actual: ' + (typeof(arg))); + } +} + +test(); +// +//////////////////////////////////////// + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/types/undefined/browser.js b/js/src/tests/test262/language/types/undefined/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/browser.js diff --git a/js/src/tests/test262/language/types/undefined/shell.js b/js/src/tests/test262/language/types/undefined/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/types/undefined/shell.js |