From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../test262/built-ins/Math/tan/S15.8.2.18_A1.js | 12 +++++++++ .../test262/built-ins/Math/tan/S15.8.2.18_A2.js | 12 +++++++++ .../test262/built-ins/Math/tan/S15.8.2.18_A3.js | 12 +++++++++ .../test262/built-ins/Math/tan/S15.8.2.18_A4.js | 12 +++++++++ .../test262/built-ins/Math/tan/S15.8.2.18_A5.js | 12 +++++++++ js/src/tests/test262/built-ins/Math/tan/browser.js | 0 js/src/tests/test262/built-ins/Math/tan/length.js | 31 ++++++++++++++++++++++ js/src/tests/test262/built-ins/Math/tan/name.js | 28 +++++++++++++++++++ .../built-ins/Math/tan/not-a-constructor.js | 31 ++++++++++++++++++++++ .../tests/test262/built-ins/Math/tan/prop-desc.js | 19 +++++++++++++ js/src/tests/test262/built-ins/Math/tan/shell.js | 24 +++++++++++++++++ 11 files changed, 193 insertions(+) create mode 100644 js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A1.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A2.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A3.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A4.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A5.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/browser.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/length.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/name.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/prop-desc.js create mode 100644 js/src/tests/test262/built-ins/Math/tan/shell.js (limited to 'js/src/tests/test262/built-ins/Math/tan') diff --git a/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A1.js b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A1.js new file mode 100644 index 0000000000..7efa079c17 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_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.tan(x) is NaN +es5id: 15.8.2.18_A1 +description: Checking if Math.tan(NaN) is NaN +---*/ + +assert.sameValue(Math.tan(NaN), NaN); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A2.js b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A2.js new file mode 100644 index 0000000000..6c43587d3f --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A2.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 +0, Math.tan(x) is +0 +es5id: 15.8.2.18_A2 +description: Checking if Math.tan(+0) equals to +0 +---*/ + +assert.sameValue(Math.tan(0), 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A3.js b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A3.js new file mode 100644 index 0000000000..6270817147 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A3.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 -0, Math.tan(x) is -0 +es5id: 15.8.2.18_A3 +description: Checking if Math.tan(-0) equals to -0 +---*/ + +assert.sameValue(Math.tan(-0), -0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A4.js b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A4.js new file mode 100644 index 0000000000..b9e16e1fe7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_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.tan(x) is NaN +es5id: 15.8.2.18_A4 +description: Checking if Math.tan(+Infinity) is NaN +---*/ + +assert.sameValue(Math.tan(Infinity), NaN); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A5.js b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_A5.js new file mode 100644 index 0000000000..6aa4a76196 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/S15.8.2.18_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.tan(x) is NaN +es5id: 15.8.2.18_A5 +description: Checking if Math.tan(-Infinity) is NaN +---*/ + +assert.sameValue(Math.tan(-Infinity), NaN); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/browser.js b/js/src/tests/test262/built-ins/Math/tan/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Math/tan/length.js b/js/src/tests/test262/built-ins/Math/tan/length.js new file mode 100644 index 0000000000..0915527693 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/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.33 +description: > + Math.tan.length is 1. +info: | + Math.tan ( 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.tan.length, 1); + +verifyNotEnumerable(Math.tan, "length"); +verifyNotWritable(Math.tan, "length"); +verifyConfigurable(Math.tan, "length"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/name.js b/js/src/tests/test262/built-ins/Math/tan/name.js new file mode 100644 index 0000000000..e1f3e188d2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/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.33 +description: > + Math.tan.name is "tan". +info: | + Math.tan ( 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.tan.name, "tan"); + +verifyNotEnumerable(Math.tan, "name"); +verifyNotWritable(Math.tan, "name"); +verifyConfigurable(Math.tan, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js b/js/src/tests/test262/built-ins/Math/tan/not-a-constructor.js new file mode 100644 index 0000000000..ea79382a35 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/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.tan 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.tan), false, 'isConstructor(Math.tan) must return false'); + +assert.throws(TypeError, () => { + new Math.tan(); +}, '`new Math.tan()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/prop-desc.js b/js/src/tests/test262/built-ins/Math/tan/prop-desc.js new file mode 100644 index 0000000000..8c36377414 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/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.tan +description: > + "tan" 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, "tan"); +verifyWritable(Math, "tan"); +verifyConfigurable(Math, "tan"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Math/tan/shell.js b/js/src/tests/test262/built-ins/Math/tan/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/built-ins/Math/tan/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; +} -- cgit v1.2.3