From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../test262/language/types/undefined/S8.1_A1_T1.js | 13 ++++++++ .../test262/language/types/undefined/S8.1_A1_T2.js | 25 +++++++++++++++ .../test262/language/types/undefined/S8.1_A2_T1.js | 36 ++++++++++++++++++++++ .../test262/language/types/undefined/S8.1_A2_T2.js | 27 ++++++++++++++++ .../test262/language/types/undefined/S8.1_A3_T1.js | 16 ++++++++++ .../test262/language/types/undefined/S8.1_A3_T2.js | 17 ++++++++++ .../test262/language/types/undefined/S8.1_A4.js | 15 +++++++++ .../test262/language/types/undefined/S8.1_A5.js | 23 ++++++++++++++ .../test262/language/types/undefined/browser.js | 0 .../test262/language/types/undefined/shell.js | 0 10 files changed, 172 insertions(+) create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A1_T1.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A1_T2.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A2_T1.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A2_T2.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A3_T1.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A3_T2.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A4.js create mode 100644 js/src/tests/test262/language/types/undefined/S8.1_A5.js create mode 100644 js/src/tests/test262/language/types/undefined/browser.js create mode 100644 js/src/tests/test262/language/types/undefined/shell.js (limited to 'js/src/tests/test262/language/types/undefined') 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 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 -- cgit v1.2.3