summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Math/sinh
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Math/sinh')
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/length.js27
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/prop-desc.js14
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/shell.js24
-rw-r--r--js/src/tests/test262/built-ins/Math/sinh/sinh-specialVals.js20
7 files changed, 144 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Math/sinh/browser.js b/js/src/tests/test262/built-ins/Math/sinh/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/browser.js
diff --git a/js/src/tests/test262/built-ins/Math/sinh/length.js b/js/src/tests/test262/built-ins/Math/sinh/length.js
new file mode 100644
index 0000000000..5071e9cc11
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/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.
+
+/*---
+description: length property of Math.sinh
+es6id: 20.2.2.31
+info: |
+ Math.sinh ( 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.sinh.length, 1);
+
+verifyNotEnumerable(Math.sinh, "length");
+verifyNotWritable(Math.sinh, "length");
+verifyConfigurable(Math.sinh, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sinh/name.js b/js/src/tests/test262/built-ins/Math/sinh/name.js
new file mode 100644
index 0000000000..b2bb918e69
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/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.31
+description: >
+ Math.sinh.name is "sinh".
+info: |
+ Math.sinh ( 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.sinh.name, "sinh");
+
+verifyNotEnumerable(Math.sinh, "name");
+verifyNotWritable(Math.sinh, "name");
+verifyConfigurable(Math.sinh, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/sinh/not-a-constructor.js
new file mode 100644
index 0000000000..9a5ff08bf7
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/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.sinh 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.sinh), false, 'isConstructor(Math.sinh) must return false');
+
+assert.throws(TypeError, () => {
+ new Math.sinh();
+}, '`new Math.sinh()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sinh/prop-desc.js b/js/src/tests/test262/built-ins/Math/sinh/prop-desc.js
new file mode 100644
index 0000000000..69d79060c6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/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.sinh
+includes: [propertyHelper.js]
+es6id: 20.2.2.31
+---*/
+
+verifyNotEnumerable(Math, "sinh");
+verifyWritable(Math, "sinh");
+verifyConfigurable(Math, "sinh");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sinh/shell.js b/js/src/tests/test262/built-ins/Math/sinh/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/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;
+}
diff --git a/js/src/tests/test262/built-ins/Math/sinh/sinh-specialVals.js b/js/src/tests/test262/built-ins/Math/sinh/sinh-specialVals.js
new file mode 100644
index 0000000000..214c9d06c7
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sinh/sinh-specialVals.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.sinh with special values
+es6id: 20.2.2.31
+---*/
+
+assert.sameValue(Math.sinh(NaN), Number.NaN,
+ "Math.sinh produces incorrect output for NaN");
+assert.sameValue(Math.sinh(Number.NEGATIVE_INFINITY), Number.NEGATIVE_INFINITY,
+ "Math.sinh should produce negative infinity for Number.NEGATIVE_INFINITY");
+assert.sameValue(Math.sinh(Number.POSITIVE_INFINITY), Number.POSITIVE_INFINITY,
+ "Math.sinh should produce positive infinity for Number.POSITIVE_INFINITY");
+assert.sameValue(1 / Math.sinh(-0), Number.NEGATIVE_INFINITY,
+ "Math.sinh should produce -0 for -0");
+assert.sameValue(1 / Math.sinh(0), Number.POSITIVE_INFINITY,
+ "Math.sinh should produce +0 for +0");
+
+reportCompare(0, 0);