From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../test262/built-ins/Date/now/15.9.4.4-0-1.js | 11 ++++++++ .../test262/built-ins/Date/now/15.9.4.4-0-2.js | 11 ++++++++ .../test262/built-ins/Date/now/15.9.4.4-0-3.js | 13 +++++++++ .../test262/built-ins/Date/now/15.9.4.4-0-4.js | 11 ++++++++ js/src/tests/test262/built-ins/Date/now/browser.js | 0 js/src/tests/test262/built-ins/Date/now/name.js | 28 +++++++++++++++++++ .../built-ins/Date/now/not-a-constructor.js | 31 ++++++++++++++++++++++ js/src/tests/test262/built-ins/Date/now/shell.js | 0 8 files changed, 105 insertions(+) create mode 100644 js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-1.js create mode 100644 js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-2.js create mode 100644 js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-3.js create mode 100644 js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-4.js create mode 100644 js/src/tests/test262/built-ins/Date/now/browser.js create mode 100644 js/src/tests/test262/built-ins/Date/now/name.js create mode 100644 js/src/tests/test262/built-ins/Date/now/not-a-constructor.js create mode 100644 js/src/tests/test262/built-ins/Date/now/shell.js (limited to 'js/src/tests/test262/built-ins/Date/now') diff --git a/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-1.js b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-1.js new file mode 100644 index 0000000000..b345e3a85e --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-1.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-date.now +description: Date.now must exist as a function +---*/ + +assert.sameValue(typeof Date.now, "function", 'typeof Date.now'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-2.js b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-2.js new file mode 100644 index 0000000000..63799dc55a --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-2.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-date.now +description: Date.now must exist as a function taking 0 parameters +---*/ + +assert.sameValue(Date.now.length, 0, 'Date.now.length'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-3.js b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-3.js new file mode 100644 index 0000000000..8325417626 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-3.js @@ -0,0 +1,13 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-date.now +description: Date.now must exist as a function +---*/ + +var fun = Date.now; + +assert.sameValue(typeof(fun), "function", 'typeof (fun)'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-4.js b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-4.js new file mode 100644 index 0000000000..7f17a75fb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/now/15.9.4.4-0-4.js @@ -0,0 +1,11 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-date.now +description: Date.now - returns number +---*/ + +assert.sameValue(typeof Date.now(), "number", 'typeof Date.now()'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/browser.js b/js/src/tests/test262/built-ins/Date/now/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Date/now/name.js b/js/src/tests/test262/built-ins/Date/now/name.js new file mode 100644 index 0000000000..4189f1f4e7 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/now/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. + +/*--- +esid: sec-date.now +description: > + Date.now.name is "now". +info: | + Date.now ( ) + + 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(Date.now.name, "now"); + +verifyNotEnumerable(Date.now, "name"); +verifyNotWritable(Date.now, "name"); +verifyConfigurable(Date.now, "name"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/not-a-constructor.js b/js/src/tests/test262/built-ins/Date/now/not-a-constructor.js new file mode 100644 index 0000000000..d6a7cf0555 --- /dev/null +++ b/js/src/tests/test262/built-ins/Date/now/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: > + Date.now 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(Date.now), false, 'isConstructor(Date.now) must return false'); + +assert.throws(TypeError, () => { + new Date.now(); +}, '`new Date.now()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Date/now/shell.js b/js/src/tests/test262/built-ins/Date/now/shell.js new file mode 100644 index 0000000000..e69de29bb2 -- cgit v1.2.3