summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Infinity
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/Infinity
parentInitial commit. (diff)
downloadfirefox-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/test262/built-ins/Infinity')
-rw-r--r--js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js17
-rw-r--r--js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js19
-rw-r--r--js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_T2.js17
-rw-r--r--js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js14
-rw-r--r--js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.js17
-rw-r--r--js/src/tests/test262/built-ins/Infinity/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Infinity/prop-desc.js19
-rw-r--r--js/src/tests/test262/built-ins/Infinity/shell.js0
8 files changed, 103 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js b/js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js
new file mode 100644
index 0000000000..b77b93d8d4
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/15.1.1.2-0.js
@@ -0,0 +1,17 @@
+// Copyright (c) 2012 Ecma International. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es5id: 15.1.1.2-0
+description: >
+ Global.Infinity is a data property with default attribute values
+ (false)
+---*/
+
+var desc = Object.getOwnPropertyDescriptor(this, 'Infinity');
+
+assert.sameValue(desc.writable, false, 'desc.writable');
+assert.sameValue(desc.enumerable, false, 'desc.enumerable');
+assert.sameValue(desc.configurable, false, 'desc.configurable');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js
new file mode 100644
index 0000000000..5d590b58c0
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A1.js
@@ -0,0 +1,19 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The initial value of Infinity is Number.POSITIVE_INFINITY
+es5id: 15.1.1.2_A1
+description: Use typeof, isNaN, isFinite
+---*/
+assert.sameValue(typeof(Infinity), "number", 'The value of `typeof(Infinity)` is expected to be "number"');
+assert.sameValue(isFinite(Infinity), false, 'isFinite(Infinity) must return false');
+assert.sameValue(isNaN(Infinity), false, 'isNaN(Infinity) must return false');
+
+assert.sameValue(
+ Infinity,
+ Number.POSITIVE_INFINITY,
+ 'The value of Infinity is expected to equal the value of Number.POSITIVE_INFINITY'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_T2.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_T2.js
new file mode 100644
index 0000000000..ab3a30005c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A2_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: The Infinity is ReadOnly
+es5id: 15.1.1.2_A2_T2
+description: Checking typeof Functions
+flags: [noStrict]
+---*/
+
+// CHECK#1
+Infinity = true;
+assert.notSameValue(typeof(Infinity), "boolean", 'The value of typeof(Infinity) is not "boolean"');
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js
new file mode 100644
index 0000000000..c168f458a0
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A3_T2.js
@@ -0,0 +1,14 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: The Infinity is DontDelete
+es5id: 15.1.1.2_A3_T2
+description: Use delete
+flags: [noStrict]
+---*/
+assert.sameValue(delete Infinity, false, 'The value of `delete Infinity` is expected to be false');
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.js b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.js
new file mode 100644
index 0000000000..c54ce9e7c1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/S15.1.1.2_A4.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: The Infinity is DontEnum
+es5id: 15.1.1.2_A4
+description: Use for-in statement
+---*/
+
+// CHECK#1
+for (var prop in this) {
+ assert.notSameValue(prop, "Infinity", 'The value of prop is not "Infinity"');
+}
+
+// TODO: Convert to verifyProperty() format.
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Infinity/browser.js b/js/src/tests/test262/built-ins/Infinity/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/browser.js
diff --git a/js/src/tests/test262/built-ins/Infinity/prop-desc.js b/js/src/tests/test262/built-ins/Infinity/prop-desc.js
new file mode 100644
index 0000000000..53eebb2713
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/prop-desc.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2019 Bocoup. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-value-properties-of-the-global-object-infinity
+description: Property descriptor of Infinity
+info: |
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]:
+ false, [[Configurable]]: false }.
+includes: [propertyHelper.js]
+---*/
+
+verifyProperty(this, "Infinity", {
+ enumerable: false,
+ writable: false,
+ configurable: false
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Infinity/shell.js b/js/src/tests/test262/built-ins/Infinity/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Infinity/shell.js