summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Math/log1p
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Math/log1p')
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/length.js30
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/prop-desc.js14
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/shell.js24
-rw-r--r--js/src/tests/test262/built-ins/Math/log1p/specific-results.js28
7 files changed, 155 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Math/log1p/browser.js b/js/src/tests/test262/built-ins/Math/log1p/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/browser.js
diff --git a/js/src/tests/test262/built-ins/Math/log1p/length.js b/js/src/tests/test262/built-ins/Math/log1p/length.js
new file mode 100644
index 0000000000..40327f636c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/length.js
@@ -0,0 +1,30 @@
+// Copyright 2015 Microsoft Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+es6id: 20.2.2.21
+description: length property of Math.log1p
+info: |
+ Math.log1p ( x )
+
+ 17 ECMAScript Standard Built-in Objects:
+ Every built-in Function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description, including optional
+ parameters. However, rest parameters shown using the form “...name”
+ are not included in the default argument count.
+
+ Unless otherwise specified, the length property of a built-in Function
+ object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: true }.
+includes: [propertyHelper.js]
+---*/
+
+assert.sameValue(Math.log1p.length, 1);
+
+verifyNotEnumerable(Math.log1p, "length");
+verifyNotWritable(Math.log1p, "length");
+verifyConfigurable(Math.log1p, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/log1p/name.js b/js/src/tests/test262/built-ins/Math/log1p/name.js
new file mode 100644
index 0000000000..9287af89ed
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/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.21
+description: >
+ Math.log1p.name is "log1p".
+info: |
+ Math.log1p ( 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.log1p.name, "log1p");
+
+verifyNotEnumerable(Math.log1p, "name");
+verifyNotWritable(Math.log1p, "name");
+verifyConfigurable(Math.log1p, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/log1p/not-a-constructor.js
new file mode 100644
index 0000000000..f89122aac0
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/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.log1p 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.log1p), false, 'isConstructor(Math.log1p) must return false');
+
+assert.throws(TypeError, () => {
+ new Math.log1p();
+}, '`new Math.log1p()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/log1p/prop-desc.js b/js/src/tests/test262/built-ins/Math/log1p/prop-desc.js
new file mode 100644
index 0000000000..8d16e87bc9
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/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.log1p
+includes: [propertyHelper.js]
+es6id: 20.2.2.21
+---*/
+
+verifyNotEnumerable(Math, "log1p");
+verifyWritable(Math, "log1p");
+verifyConfigurable(Math, "log1p");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/log1p/shell.js b/js/src/tests/test262/built-ins/Math/log1p/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/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/log1p/specific-results.js b/js/src/tests/test262/built-ins/Math/log1p/specific-results.js
new file mode 100644
index 0000000000..38452abf77
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/log1p/specific-results.js
@@ -0,0 +1,28 @@
+// 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.log1p
+description: >
+ Return specific results
+info: |
+ Math.log1p ( x )
+
+ If x is NaN, the result is NaN.
+ If x is less than -1, the result is NaN.
+ If x is -1, the result is -∞.
+ If x is +0, the result is +0.
+ If x is -0, the result is -0.
+ If x is +∞, the result is +∞.
+---*/
+
+assert.sameValue(Math.log1p(NaN), NaN, "NaN");
+assert.sameValue(Math.log1p(-1.000001), NaN, "-1.000001");
+assert.sameValue(Math.log1p(-2), NaN, "-2");
+assert.sameValue(Math.log1p(-Infinity), NaN, "-Infinity");
+assert.sameValue(Math.log1p(-1), -Infinity, "-1");
+assert.sameValue(Math.log1p(0), 0, "0");
+assert.sameValue(Math.log1p(-0), -0, "-0");
+assert.sameValue(Math.log1p(Infinity), Infinity, "Infinity");
+
+reportCompare(0, 0);