summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Math/acosh
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/Math/acosh
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/Math/acosh')
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/arg-is-infinity.js16
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/arg-is-one.js15
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/length.js27
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/nan-returns.js20
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/prop-desc.js14
-rw-r--r--js/src/tests/test262/built-ins/Math/acosh/shell.js24
9 files changed, 175 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Math/acosh/arg-is-infinity.js b/js/src/tests/test262/built-ins/Math/acosh/arg-is-infinity.js
new file mode 100644
index 0000000000..087498f3f1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/arg-is-infinity.js
@@ -0,0 +1,16 @@
+// Copyright (C) 2016 The V8 Project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-math.acosh
+description: >
+ Return Infinity if x is Infinity
+info: |
+ Math.acosh ( x )
+
+ If x is +∞, the result is +∞.
+---*/
+
+assert.sameValue(Math.acosh(Infinity), Infinity);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/arg-is-one.js b/js/src/tests/test262/built-ins/Math/acosh/arg-is-one.js
new file mode 100644
index 0000000000..5d03d7d930
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/arg-is-one.js
@@ -0,0 +1,15 @@
+// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.acosh(1) returns +0
+es6id: 20.2.2.3
+info: |
+ Math.acosh ( x )
+
+ - If x is 1, the result is +0.
+---*/
+
+assert.sameValue(Math.acosh(+1), 0, "Math.acosh should produce 0 for +1");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/browser.js b/js/src/tests/test262/built-ins/Math/acosh/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/browser.js
diff --git a/js/src/tests/test262/built-ins/Math/acosh/length.js b/js/src/tests/test262/built-ins/Math/acosh/length.js
new file mode 100644
index 0000000000..10b7e3c234
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/length.js
@@ -0,0 +1,27 @@
+// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+es6id: 20.2.2.3
+description: length property of Math.acosh
+info: |
+ Math.acosh ( x )
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Math.acosh.length, 1);
+
+verifyNotEnumerable(Math.acosh, "length");
+verifyNotWritable(Math.acosh, "length");
+verifyConfigurable(Math.acosh, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/name.js b/js/src/tests/test262/built-ins/Math/acosh/name.js
new file mode 100644
index 0000000000..5ff5df412f
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/name.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es6id: 20.2.2.3
+description: >
+ Math.acosh.name is "acosh".
+info: |
+ Math.acosh ( x )
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String.
+
+ Unless otherwise specified, the name property of a built-in Function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Math.acosh.name, "acosh");
+
+verifyNotEnumerable(Math.acosh, "name");
+verifyNotWritable(Math.acosh, "name");
+verifyConfigurable(Math.acosh, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/nan-returns.js b/js/src/tests/test262/built-ins/Math/acosh/nan-returns.js
new file mode 100644
index 0000000000..17a96a2adb
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/nan-returns.js
@@ -0,0 +1,20 @@
+// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Math.acosh with special values
+es6id: 20.2.2.3
+info: |
+ Math.acosh ( x )
+
+ - If x is NaN, the result is NaN.
+ - If x is less than 1, the result is NaN.
+---*/
+
+assert.sameValue(Math.acosh(NaN), NaN, "NaN");
+assert.sameValue(Math.acosh(0.999999), NaN, "0.999999");
+assert.sameValue(Math.acosh(0), NaN, "0");
+assert.sameValue(Math.acosh(-1), NaN, "-1");
+assert.sameValue(Math.acosh(-Infinity), NaN, "-Infinity");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js
new file mode 100644
index 0000000000..b9866a9eb4
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/not-a-constructor.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2020 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-ecmascript-standard-built-in-objects
+description: >
+ Math.acosh does not implement [[Construct]], is not new-able
+info: |
+ ECMAScript Function Objects
+
+ Built-in function objects that are not identified as constructors do not
+ implement the [[Construct]] internal method unless otherwise specified in
+ the description of a particular function.
+
+ sec-evaluatenew
+
+ ...
+ 7. If IsConstructor(constructor) is false, throw a TypeError exception.
+ ...
+includes: [isConstructor.js]
+features: [Reflect.construct, arrow-function]
+---*/
+
+assert.sameValue(isConstructor(Math.acosh), false, 'isConstructor(Math.acosh) must return false');
+
+assert.throws(TypeError, () => {
+ new Math.acosh();
+}, '`new Math.acosh()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/prop-desc.js b/js/src/tests/test262/built-ins/Math/acosh/prop-desc.js
new file mode 100644
index 0000000000..2e574afcc2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/prop-desc.js
@@ -0,0 +1,14 @@
+// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+description: Testing descriptor property of Math.acosh
+includes: [propertyHelper.js]
+es6id: 20.2.2.3
+---*/
+
+verifyNotEnumerable(Math, "acosh");
+verifyWritable(Math, "acosh");
+verifyConfigurable(Math, "acosh");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/acosh/shell.js b/js/src/tests/test262/built-ins/Math/acosh/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/acosh/shell.js
@@ -0,0 +1,24 @@
+// GENERATED, DO NOT EDIT
+// file: isConstructor.js
+// Copyright (C) 2017 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: |
+ Test if a given function is a constructor function.
+defines: [isConstructor]
+features: [Reflect.construct]
+---*/
+
+function isConstructor(f) {
+ if (typeof f !== "function") {
+ throw new Test262Error("isConstructor invoked with a non-function value");
+ }
+
+ try {
+ Reflect.construct(function(){}, [], f);
+ } catch (e) {
+ return false;
+ }
+ return true;
+}