From b4efa8c938e96abfa131ebb0e242ae3da02aaee8 Mon Sep 17 00:00:00 2001 From: Ms2ger <Ms2ger@gmail.com> Date: Tue, 26 Jun 2018 20:02:29 +0200 Subject: [PATCH] Add tests for the shape of the Intl.RelativeTimeFormat API. (#1596) * Add Intl.RelativeTimeFormat feature. * Add tests for the shape of the Intl.RelativeTimeFormat API. * fixup! Add tests for the shape of the Intl.RelativeTimeFormat API. --- features.txt | 4 ++ harness/testIntl.js | 58 +++++++++++++++++++ .../constructor/locales-invalid.js | 16 +++++ .../constructor/newtarget-undefined.js | 25 ++++++++ .../constructor/options-invalid.js | 14 +++++ .../constructor/constructor/options-order.js | 55 ++++++++++++++++++ .../RelativeTimeFormat/constructor/length.js | 22 +++++++ .../RelativeTimeFormat/constructor/name.js | 21 +++++++ .../constructor/prop-desc.js | 35 +++++++++++ .../constructor/prototype.js | 17 ++++++ .../supportedLocalesOf/branding.js | 29 ++++++++++ .../constructor/supportedLocalesOf/length.js | 22 +++++++ .../constructor/supportedLocalesOf/name.js | 21 +++++++ .../supportedLocalesOf/prop-desc.js | 29 ++++++++++ .../instance/extensibility.js | 20 +++++++ .../RelativeTimeFormat/instance/prototype.js | 20 +++++++ .../prototype/constructor/prop-desc.js | 24 ++++++++ .../prototype/format/branding.js | 24 ++++++++ .../prototype/format/length.js | 21 +++++++ .../prototype/format/name.js | 20 +++++++ .../prototype/format/prop-desc.js | 28 +++++++++ .../prototype/formatToParts/branding.js | 24 ++++++++ .../prototype/formatToParts/length.js | 21 +++++++ .../prototype/formatToParts/name.js | 20 +++++++ .../prototype/formatToParts/prop-desc.js | 28 +++++++++ .../RelativeTimeFormat/prototype/prop-desc.js | 22 +++++++ .../prototype/resolvedOptions/branding.js | 24 ++++++++ .../prototype/resolvedOptions/length.js | 21 +++++++ .../prototype/resolvedOptions/name.js | 20 +++++++ .../prototype/resolvedOptions/prop-desc.js | 28 +++++++++ .../prototype/toStringTag/toStringTag.js | 23 ++++++++ 31 files changed, 756 insertions(+) create mode 100644 test/intl402/RelativeTimeFormat/constructor/constructor/locales-invalid.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/constructor/options-invalid.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/constructor/options-order.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/length.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/name.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/prototype.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/name.js create mode 100644 test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/instance/extensibility.js create mode 100644 test/intl402/RelativeTimeFormat/instance/prototype.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/constructor/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/format/branding.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/format/length.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/format/name.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/format/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/formatToParts/length.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/formatToParts/name.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/formatToParts/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/resolvedOptions/length.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/resolvedOptions/name.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/resolvedOptions/prop-desc.js create mode 100644 test/intl402/RelativeTimeFormat/prototype/toStringTag/toStringTag.js diff --git a/features.txt b/features.txt index e8928baa92..395ff3aa93 100644 --- a/features.txt +++ b/features.txt @@ -89,6 +89,10 @@ json-superset # https://github.com/tc39/proposal-intl-locale Intl.Locale +# Intl.RelativeTimeFormat +# https://github.com/tc39/proposal-intl-relative-time +Intl.RelativeTimeFormat + # Global # https://github.com/tc39/proposal-global global diff --git a/harness/testIntl.js b/harness/testIntl.js index 614383a3b4..6cb349abf1 100644 --- a/harness/testIntl.js +++ b/harness/testIntl.js @@ -771,6 +771,64 @@ function isCanonicalizedStructurallyValidLanguageTag(locale) { } +/** + * Returns an array of error cases handled by CanonicalizeLocaleList(). + */ +function getInvalidLocaleArguments() { + function CustomError() {} + + var topLevelErrors = [ + // fails ToObject + [null, TypeError], + + // fails Get + [{ get length() { throw new CustomError(); } }, CustomError], + + // fail ToLength + [{ length: Symbol.toPrimitive }, TypeError], + [{ length: { get [Symbol.toPrimitive]() { throw new CustomError(); } } }, CustomError], + [{ length: { [Symbol.toPrimitive]() { throw new CustomError(); } } }, CustomError], + [{ length: { get valueOf() { throw new CustomError(); } } }, CustomError], + [{ length: { valueOf() { throw new CustomError(); } } }, CustomError], + [{ length: { get toString() { throw new CustomError(); } } }, CustomError], + [{ length: { toString() { throw new CustomError(); } } }, CustomError], + + // fail type check + [[undefined], TypeError], + [[null], TypeError], + [[true], TypeError], + [[Symbol.toPrimitive], TypeError], + [[1], TypeError], + [[0.1], TypeError], + [[NaN], TypeError], + ]; + + var invalidLanguageTags = [ + "", // empty tag + "i", // singleton alone + "x", // private use without subtag + "u", // extension singleton in first place + "419", // region code in first place + "u-nu-latn-cu-bob", // extension sequence without language + "hans-cmn-cn", // "hans" could theoretically be a 4-letter language code, + // but those can't be followed by extlang codes. + "cmn-hans-cn-u-u", // duplicate singleton + "cmn-hans-cn-t-u-ca-u", // duplicate singleton + "de-gregory-gregory", // duplicate variant + "*", // language range + "de-*", // language range + "ä¸æ–‡", // non-ASCII letters + "en-ß", // non-ASCII letters + "ıd" // non-ASCII letters + ]; + + return topLevelErrors.concat( + invalidLanguageTags.map(tag => [tag, RangeError]), + invalidLanguageTags.map(tag => [[tag], RangeError]), + invalidLanguageTags.map(tag => [["en", tag], RangeError]), + ) +} + /** * Tests whether the named options property is correctly handled by the given constructor. * @param {object} Constructor the constructor to test. diff --git a/test/intl402/RelativeTimeFormat/constructor/constructor/locales-invalid.js b/test/intl402/RelativeTimeFormat/constructor/constructor/locales-invalid.js new file mode 100644 index 0000000000..9c98223d41 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/constructor/locales-invalid.js @@ -0,0 +1,16 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: Checks error cases for the locales argument to the RelativeTimeFormat constructor. +info: | + InitializeRelativeTimeFormat (relativeTimeFormat, locales, options) + 3. Let _requestedLocales_ be ? CanonicalizeLocaleList(_locales_). +includes: [testIntl.js] +features: [Intl.RelativeTimeFormat] +---*/ + +for (const [locales, expectedError] of getInvalidLocaleArguments()) { + assert.throws(expectedError, function() { new Intl.RelativeTimeFormat(locales) }) +} diff --git a/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js b/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js new file mode 100644 index 0000000000..e4775cc517 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js @@ -0,0 +1,25 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.RelativeTimeFormat +description: > + Verifies the NewTarget check for Intl.RelativeTimeFormat. +info: | + Intl.RelativeTimeFormat ([ locales [ , options ]]) + + 1. If NewTarget is undefined, throw a TypeError exception. +features: [Intl.RelativeTimeFormat] +---*/ + +assert.throws(TypeError, function() { + Intl.RelativeTimeFormat(); +}); + +assert.throws(TypeError, function() { + Intl.RelativeTimeFormat("en"); +}); + +assert.throws(TypeError, function() { + Intl.RelativeTimeFormat("not-valid-tag"); +}); diff --git a/test/intl402/RelativeTimeFormat/constructor/constructor/options-invalid.js b/test/intl402/RelativeTimeFormat/constructor/constructor/options-invalid.js new file mode 100644 index 0000000000..90df4ffdb4 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/constructor/options-invalid.js @@ -0,0 +1,14 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: Checks handling of a null options argument to the RelativeTimeFormat constructor. +info: | + InitializeRelativeTimeFormat (relativeTimeFormat, locales, options) + 5. Else + a. Let options be ? ToObject(options). +features: [Intl.RelativeTimeFormat] +---*/ + +assert.throws(TypeError, function() { new Intl.RelativeTimeFormat([], null) }) diff --git a/test/intl402/RelativeTimeFormat/constructor/constructor/options-order.js b/test/intl402/RelativeTimeFormat/constructor/constructor/options-order.js new file mode 100644 index 0000000000..65592b7d8b --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/constructor/options-order.js @@ -0,0 +1,55 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: Checks the order of operations on the options argument to the RelativeTimeFormat constructor. +info: | + InitializeRelativeTimeFormat (relativeTimeFormat, locales, options) + 7. Let matcher be ? GetOption(options, "localeMatcher", "string", «"lookup", "best fit"», "best fit"). + 14. Let s be ? GetOption(options, "style", "string", «"long", "short", "narrow"», "long"). + 16. Let numeric be ? GetOption(options, "numeric", "string", «"always", "auto"», "always"). +includes: [compareArray.js] +features: [Intl.RelativeTimeFormat] +---*/ + +const callOrder = []; + +new Intl.RelativeTimeFormat([], { + get localeMatcher() { + callOrder.push("localeMatcher"); + return { + toString() { + callOrder.push("localeMatcher toString"); + return "best fit"; + } + }; + }, + get style() { + callOrder.push("style"); + return { + toString() { + callOrder.push("style toString"); + return "long"; + } + }; + }, + get numeric() { + callOrder.push("numeric"); + return { + toString() { + callOrder.push("numeric toString"); + return "always"; + } + }; + }, +}); + +assert.compareArray(callOrder, [ + "localeMatcher", + "localeMatcher toString", + "style", + "style toString", + "numeric", + "numeric toString", +]); diff --git a/test/intl402/RelativeTimeFormat/constructor/length.js b/test/intl402/RelativeTimeFormat/constructor/length.js new file mode 100644 index 0000000000..4a9c0d6110 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/length.js @@ -0,0 +1,22 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: > + Checks the "length" property of the RelativeTimeFormat constructor. +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + The RelativeTimeFormat constructor is a standard built-in property of the Intl object. + 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. Optional parameters (which are indicated with brackets: [ ]) or rest parameters (which are 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/constructor/name.js b/test/intl402/RelativeTimeFormat/constructor/name.js new file mode 100644 index 0000000000..5a403cc041 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/name.js @@ -0,0 +1,21 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: > + Checks the "name" property of the RelativeTimeFormat constructor. +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + 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, this value is the name that is given to the function in this specification. + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat, "name", { + value: "RelativeTimeFormat", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/constructor/prop-desc.js b/test/intl402/RelativeTimeFormat/constructor/prop-desc.js new file mode 100644 index 0000000000..cfa475cf5d --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/prop-desc.js @@ -0,0 +1,35 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: > + "RelativeTimeFormat" property of Intl. +info: | + Intl.RelativeTimeFormat (...) + + 7 Requirements for Standard Built-in ECMAScript Objects + + Unless specified otherwise in this document, the objects, functions, and constructors + described in this standard are subject to the generic requirements and restrictions + specified for standard built-in ECMAScript objects in the ECMAScript 2018 Language + Specification, 9th edition, clause 17, or successor. + + 17 ECMAScript Standard Built-in Objects: + + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue(typeof Intl.RelativeTimeFormat, "function"); + +verifyProperty(Intl, "RelativeTimeFormat", { + value: Intl.RelativeTimeFormat, + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/intl402/RelativeTimeFormat/constructor/prototype.js b/test/intl402/RelativeTimeFormat/constructor/prototype.js new file mode 100644 index 0000000000..c9a8e5376f --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/prototype.js @@ -0,0 +1,17 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: The prototype of the Intl.RelativeTimeFormat constructor is %FunctionPrototype%. +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + Unless otherwise specified every built-in function object has the %FunctionPrototype% object as the initial value of its [[Prototype]] internal slot. +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue( + Object.getPrototypeOf(Intl.RelativeTimeFormat), + Function.prototype, + "Object.getPrototypeOf(Intl.RelativeTimeFormat) equals the value of Function.prototype" +); diff --git a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js new file mode 100644 index 0000000000..5b6384bd06 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js @@ -0,0 +1,29 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf +description: > + Verifies there's no branding check for Intl.RelativeTimeFormat.supportedLocalesOf(). +info: | + Intl.RelativeTimeFormat.supportedLocalesOf ( locales [, options ]) +features: [Intl.RelativeTimeFormat] +---*/ + +const fn = Intl.RelativeTimeFormat.supportedLocalesOf; +const thisValues = [ + undefined, + null, + true, + "", + Symbol(), + 1, + {}, + Intl.RelativeTimeFormat, + Intl.RelativeTimeFormat.prototype, +]; + +for (const thisValue of thisValues) { + const result = fn.call(thisValue); + assert.sameValue(Array.isArray(result), true); +} diff --git a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js new file mode 100644 index 0000000000..d512a12ca4 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js @@ -0,0 +1,22 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf +description: > + Checks the "length" property of Intl.RelativeTimeFormat.supportedLocalesOf(). +info: | + The value of the length property of the supportedLocalesOf method is 1. + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + Every built-in function object, including constructors, has a length property whose value is an integer. + Unless otherwise specified, the length property of a built-in function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.supportedLocalesOf, "length", { + value: 1, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/name.js b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/name.js new file mode 100644 index 0000000000..f13412c38a --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/name.js @@ -0,0 +1,21 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf +description: > + Checks the "name" property of Intl.RelativeTimeFormat.supportedLocalesOf(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + 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, this value is the name that is given to the function in this specification. + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.supportedLocalesOf, "name", { + value: "supportedLocalesOf", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/prop-desc.js b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/prop-desc.js new file mode 100644 index 0000000000..c06e11af93 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/prop-desc.js @@ -0,0 +1,29 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.supportedLocalesOf +description: > + Checks the "supportedLocalesOf" property of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.supportedLocalesOf ( locales [, options ]) + + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue( + typeof Intl.RelativeTimeFormat.supportedLocalesOf, + "function", + "typeof Intl.RelativeTimeFormat.supportedLocalesOf is function" +); + +verifyProperty(Intl.RelativeTimeFormat, "supportedLocalesOf", { + writable: true, + enumerable: false, + configurable: true, +}); + diff --git a/test/intl402/RelativeTimeFormat/instance/extensibility.js b/test/intl402/RelativeTimeFormat/instance/extensibility.js new file mode 100644 index 0000000000..d157efe4c0 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/instance/extensibility.js @@ -0,0 +1,20 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: > + Intl.RelativeTimeFormat instance object extensibility +info: | + 17 ECMAScript Standard Built-in Objects: + + Unless specified otherwise, the [[Extensible]] internal slot + of a built-in object initially has the value true. +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue( + Object.isExtensible(new Intl.RelativeTimeFormat()), + true, + "Object.isExtensible(new Intl.RelativeTimeFormat()) returns true" +); diff --git a/test/intl402/RelativeTimeFormat/instance/prototype.js b/test/intl402/RelativeTimeFormat/instance/prototype.js new file mode 100644 index 0000000000..a24962f128 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/instance/prototype.js @@ -0,0 +1,20 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat +description: > + Intl.RelativeTimeFormat instance object is created from %RelativeTimeFormatPrototype%. +info: | + Intl.RelativeTimeFormat ([ locales [ , options ]]) + + 2. Let relativeTimeFormat be ! OrdinaryCreateFromConstructor(NewTarget, "%RelativeTimeFormatPrototype%"). +features: [Intl.RelativeTimeFormat] +---*/ + +const value = new Intl.RelativeTimeFormat(); +assert.sameValue( + Object.getPrototypeOf(value), + Intl.RelativeTimeFormat.prototype, + "Object.getPrototypeOf(value) equals the value of Intl.RelativeTimeFormat.prototype" +); diff --git a/test/intl402/RelativeTimeFormat/prototype/constructor/prop-desc.js b/test/intl402/RelativeTimeFormat/prototype/constructor/prop-desc.js new file mode 100644 index 0000000000..f793ad2e04 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/constructor/prop-desc.js @@ -0,0 +1,24 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.constructor +description: Checks the "constructor" property of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.constructor + + The initial value of Intl.RelativeTimeFormat.prototype.constructor is %RelativeTimeFormat%. + + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype, "constructor", { + value: Intl.RelativeTimeFormat, + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/format/branding.js b/test/intl402/RelativeTimeFormat/prototype/format/branding.js new file mode 100644 index 0000000000..8dddd83b90 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/format/branding.js @@ -0,0 +1,24 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.format +description: Verifies the branding check for the "format" function of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.format( value, unit ) + + 2. If Type(relativeTimeFormat) is not Object or relativeTimeFormat does not have an [[InitializedRelativeTimeFormat]] internal slot whose value is true, throw a TypeError exception. +features: [Intl.RelativeTimeFormat] +---*/ + +const fn = Intl.RelativeTimeFormat.prototype.format; + +assert.throws(TypeError, () => fn.call(undefined), "undefined"); +assert.throws(TypeError, () => fn.call(null), "null"); +assert.throws(TypeError, () => fn.call(true), "true"); +assert.throws(TypeError, () => fn.call(""), "empty string"); +assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); +assert.throws(TypeError, () => fn.call(1), "1"); +assert.throws(TypeError, () => fn.call({}), "plain object"); +assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); +assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); diff --git a/test/intl402/RelativeTimeFormat/prototype/format/length.js b/test/intl402/RelativeTimeFormat/prototype/format/length.js new file mode 100644 index 0000000000..b9cdb059e5 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/format/length.js @@ -0,0 +1,21 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.format +description: Checks the "length" property of Intl.RelativeTimeFormat.prototype.format(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + The RelativeTimeFormat constructor is a standard built-in property of the Intl object. + 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. Optional parameters (which are indicated with brackets: [ ]) or rest parameters (which are 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype.format, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/format/name.js b/test/intl402/RelativeTimeFormat/prototype/format/name.js new file mode 100644 index 0000000000..15ba118e16 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/format/name.js @@ -0,0 +1,20 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.format +description: Checks the "name" property of Intl.RelativeTimeFormat.prototype.format(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + 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, this value is the name that is given to the function in this specification. + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype.format, "name", { + value: "format", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/format/prop-desc.js b/test/intl402/RelativeTimeFormat/prototype/format/prop-desc.js new file mode 100644 index 0000000000..b6e507f2ac --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/format/prop-desc.js @@ -0,0 +1,28 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.format +description: Checks the "format" property of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.format () + + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue( + typeof Intl.RelativeTimeFormat.prototype.format, + "function", + "typeof Intl.RelativeTimeFormat.prototype.format is function" +); + +verifyProperty(Intl.RelativeTimeFormat.prototype, "format", { + writable: true, + enumerable: false, + configurable: true, +}); + diff --git a/test/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js b/test/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js new file mode 100644 index 0000000000..d654275554 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js @@ -0,0 +1,24 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.formatToParts +description: Verifies the branding check for the "formatToParts" function of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.formatToParts( value, unit ) + + 2. If Type(relativeTimeFormat) is not Object or relativeTimeFormat does not have an [[InitializedRelativeTimeFormat]] internal slot whose value is true, throw a TypeError exception. +features: [Intl.RelativeTimeFormat] +---*/ + +const fn = Intl.RelativeTimeFormat.prototype.formatToParts; + +assert.throws(TypeError, () => fn.call(undefined), "undefined"); +assert.throws(TypeError, () => fn.call(null), "null"); +assert.throws(TypeError, () => fn.call(true), "true"); +assert.throws(TypeError, () => fn.call(""), "empty string"); +assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); +assert.throws(TypeError, () => fn.call(1), "1"); +assert.throws(TypeError, () => fn.call({}), "plain object"); +assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); +assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); diff --git a/test/intl402/RelativeTimeFormat/prototype/formatToParts/length.js b/test/intl402/RelativeTimeFormat/prototype/formatToParts/length.js new file mode 100644 index 0000000000..7d85d8b619 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/length.js @@ -0,0 +1,21 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.formatToParts +description: Checks the "length" property of Intl.RelativeTimeFormat.prototype.formatToParts(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + The RelativeTimeFormat constructor is a standard built-in property of the Intl object. + 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. Optional parameters (which are indicated with brackets: [ ]) or rest parameters (which are 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype.formatToParts, "length", { + value: 2, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/formatToParts/name.js b/test/intl402/RelativeTimeFormat/prototype/formatToParts/name.js new file mode 100644 index 0000000000..08dbd9e582 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/name.js @@ -0,0 +1,20 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.formatToParts +description: Checks the "name" property of Intl.RelativeTimeFormat.prototype.formatToParts(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + 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, this value is the name that is given to the function in this specification. + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype.formatToParts, "name", { + value: "formatToParts", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/formatToParts/prop-desc.js b/test/intl402/RelativeTimeFormat/prototype/formatToParts/prop-desc.js new file mode 100644 index 0000000000..103ff3d5d3 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/formatToParts/prop-desc.js @@ -0,0 +1,28 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.formatToParts +description: Checks the "formatToParts" property of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.formatToParts () + + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue( + typeof Intl.RelativeTimeFormat.prototype.formatToParts, + "function", + "typeof Intl.RelativeTimeFormat.prototype.formatToParts is function" +); + +verifyProperty(Intl.RelativeTimeFormat.prototype, "formatToParts", { + writable: true, + enumerable: false, + configurable: true, +}); + diff --git a/test/intl402/RelativeTimeFormat/prototype/prop-desc.js b/test/intl402/RelativeTimeFormat/prototype/prop-desc.js new file mode 100644 index 0000000000..011c9c4017 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/prop-desc.js @@ -0,0 +1,22 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype +description: > + Checks the "prototype" property of the RelativeTimeFormat constructor. +info: | + Intl.RelativeTimeFormat.prototype + + The value of Intl.RelativeTimeFormat.prototype is %RelativeTimeFormatPrototype%. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }. +includes: [propertyHelper.js] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat, "prototype", { + writable: false, + enumerable: false, + configurable: false, +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js new file mode 100644 index 0000000000..104649ece7 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js @@ -0,0 +1,24 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.resolvedOptions +description: Verifies the branding check for the "resolvedOptions" function of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.resolvedOptions( value, unit ) + + 2. If Type(relativeTimeFormat) is not Object or relativeTimeFormat does not have an [[InitializedRelativeTimeFormat]] internal slot whose value is true, throw a TypeError exception. +features: [Intl.RelativeTimeFormat] +---*/ + +const fn = Intl.RelativeTimeFormat.prototype.resolvedOptions; + +assert.throws(TypeError, () => fn.call(undefined), "undefined"); +assert.throws(TypeError, () => fn.call(null), "null"); +assert.throws(TypeError, () => fn.call(true), "true"); +assert.throws(TypeError, () => fn.call(""), "empty string"); +assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); +assert.throws(TypeError, () => fn.call(1), "1"); +assert.throws(TypeError, () => fn.call({}), "plain object"); +assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); +assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); diff --git a/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/length.js b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/length.js new file mode 100644 index 0000000000..5331691172 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/length.js @@ -0,0 +1,21 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.resolvedOptions +description: Checks the "length" property of Intl.RelativeTimeFormat.prototype.resolvedOptions(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + The RelativeTimeFormat constructor is a standard built-in property of the Intl object. + 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. Optional parameters (which are indicated with brackets: [ ]) or rest parameters (which are 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype.resolvedOptions, "length", { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/name.js b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/name.js new file mode 100644 index 0000000000..e739618795 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/name.js @@ -0,0 +1,20 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.resolvedOptions +description: Checks the "name" property of Intl.RelativeTimeFormat.prototype.resolvedOptions(). +info: | + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + 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, this value is the name that is given to the function in this specification. + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype.resolvedOptions, "name", { + value: "resolvedOptions", + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/prop-desc.js b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/prop-desc.js new file mode 100644 index 0000000000..9107bfeb98 --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/prop-desc.js @@ -0,0 +1,28 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.RelativeTimeFormat.prototype.resolvedOptions +description: Checks the "resolvedOptions" property of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype.resolvedOptions () + + Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. + + 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] +features: [Intl.RelativeTimeFormat] +---*/ + +assert.sameValue( + typeof Intl.RelativeTimeFormat.prototype.resolvedOptions, + "function", + "typeof Intl.RelativeTimeFormat.prototype.resolvedOptions is function" +); + +verifyProperty(Intl.RelativeTimeFormat.prototype, "resolvedOptions", { + writable: true, + enumerable: false, + configurable: true, +}); + diff --git a/test/intl402/RelativeTimeFormat/prototype/toStringTag/toStringTag.js b/test/intl402/RelativeTimeFormat/prototype/toStringTag/toStringTag.js new file mode 100644 index 0000000000..073d08a64e --- /dev/null +++ b/test/intl402/RelativeTimeFormat/prototype/toStringTag/toStringTag.js @@ -0,0 +1,23 @@ +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.RelativeTimeFormat.prototype-@@tostringtag +description: > + Checks the @@toStringTag property of the RelativeTimeFormat prototype object. +info: | + Intl.RelativeTimeFormat.prototype[ @@toStringTag ] + + The initial value of the @@toStringTag property is the string value "Object". + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [Intl.RelativeTimeFormat, Symbol.toStringTag] +---*/ + +verifyProperty(Intl.RelativeTimeFormat.prototype, Symbol.toStringTag, { + value: "Object", + writable: false, + enumerable: false, + configurable: true +}); -- GitLab