summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Math/sin
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/sin
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/sin')
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A1.js12
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A4.js12
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A5.js12
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/browser.js0
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/length.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/name.js28
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js31
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/prop-desc.js19
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/shell.js24
-rw-r--r--js/src/tests/test262/built-ins/Math/sin/zero.js12
10 files changed, 181 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A1.js b/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A1.js
new file mode 100644
index 0000000000..f468c005a1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A1.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is NaN, Math.sin(x) is NaN
+es5id: 15.8.2.16_A1
+description: Checking if Math.sin(NaN) is NaN
+---*/
+
+assert.sameValue(Math.sin(NaN), NaN);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A4.js b/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A4.js
new file mode 100644
index 0000000000..83101169b4
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A4.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is +Infinity, Math.sin(x) is NaN
+es5id: 15.8.2.16_A4
+description: Checking if Math.sin(+Infinity) is NaN
+---*/
+
+assert.sameValue(Math.sin(Infinity), NaN);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A5.js b/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A5.js
new file mode 100644
index 0000000000..f90ffc984d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/S15.8.2.16_A5.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: If x is -Infinity, Math.sin(x) is NaN
+es5id: 15.8.2.16_A5
+description: Checking if Math.sin(-Infinity) is NaN
+---*/
+
+assert.sameValue(Math.sin(-Infinity), NaN);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/browser.js b/js/src/tests/test262/built-ins/Math/sin/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/browser.js
diff --git a/js/src/tests/test262/built-ins/Math/sin/length.js b/js/src/tests/test262/built-ins/Math/sin/length.js
new file mode 100644
index 0000000000..887df3bb9d
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/length.js
@@ -0,0 +1,31 @@
+// 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.30
+description: >
+ Math.sin.length is 1.
+info: |
+ Math.sin ( 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.sin.length, 1);
+
+verifyNotEnumerable(Math.sin, "length");
+verifyNotWritable(Math.sin, "length");
+verifyConfigurable(Math.sin, "length");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/name.js b/js/src/tests/test262/built-ins/Math/sin/name.js
new file mode 100644
index 0000000000..af0bb7c8a9
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/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.30
+description: >
+ Math.sin.name is "sin".
+info: |
+ Math.sin ( 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.sin.name, "sin");
+
+verifyNotEnumerable(Math.sin, "name");
+verifyNotWritable(Math.sin, "name");
+verifyConfigurable(Math.sin, "name");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/sin/not-a-constructor.js
new file mode 100644
index 0000000000..fec296dc85
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/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.sin 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.sin), false, 'isConstructor(Math.sin) must return false');
+
+assert.throws(TypeError, () => {
+ new Math.sin();
+}, '`new Math.sin()` throws TypeError');
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/prop-desc.js b/js/src/tests/test262/built-ins/Math/sin/prop-desc.js
new file mode 100644
index 0000000000..882e1cecf7
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/prop-desc.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-math.sin
+description: >
+ "sin" property of Math
+info: |
+ Section 17: Every other data property described in clauses 18 through 26
+ and in Annex B.2 has the attributes { [[Writable]]: true,
+ [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
+includes: [propertyHelper.js]
+---*/
+
+verifyNotEnumerable(Math, "sin");
+verifyWritable(Math, "sin");
+verifyConfigurable(Math, "sin");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/Math/sin/shell.js b/js/src/tests/test262/built-ins/Math/sin/shell.js
new file mode 100644
index 0000000000..eda1477282
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/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/sin/zero.js b/js/src/tests/test262/built-ins/Math/sin/zero.js
new file mode 100644
index 0000000000..e46664c047
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Math/sin/zero.js
@@ -0,0 +1,12 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+es5id: 15.8.2.16_A3
+description: Return arg if -0 or +0
+---*/
+
+assert.sameValue(Math.sin(0), 0, "+0");
+assert.sameValue(Math.sin(-0), -0, "-0");
+
+reportCompare(0, 0);