diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/tests/test262/built-ins/Math/acosh | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Math/acosh')
9 files changed, 170 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..54371b7789 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/acosh/shell.js @@ -0,0 +1,19 @@ +// 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] +---*/ + +function isConstructor(f) { + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} |