diff --git a/harness/features.yml b/harness/features.yml index 177bec32bd..d08adaf646 100644 --- a/harness/features.yml +++ b/harness/features.yml @@ -1,3 +1,4 @@ typeCoercion.js: [Symbol.toPrimitive, BigInt] testAtomics.js: [ArrayBuffer, Atomics, DataView, SharedArrayBuffer, arrow-function, let, for-of] testTypedArray.js: [TypedArray] +isConstructor.js: [Reflect.construct] diff --git a/harness/isConstructor.js b/harness/isConstructor.js new file mode 100644 index 0000000000..bf7433219e --- /dev/null +++ b/harness/isConstructor.js @@ -0,0 +1,16 @@ +// 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. +---*/ + +function isConstructor(f) { + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/test/intl402/Collator/prototype/compare/10.3.2_1_a_L15.js b/test/intl402/Collator/prototype/compare/10.3.2_1_a_L15.js index db72d12a29..0d40250aff 100644 --- a/test/intl402/Collator/prototype/compare/10.3.2_1_a_L15.js +++ b/test/intl402/Collator/prototype/compare/10.3.2_1_a_L15.js @@ -9,7 +9,22 @@ description: > built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(new Intl.Collator().compare); +var compareFn = new Intl.Collator().compare; + +assert.sameValue(Object.prototype.toString.call(compareFn), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(compareFn), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(compareFn), Function.prototype); + +assert.sameValue(compareFn.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(compareFn), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Collator/prototype/compare/10.3.2_L15.js b/test/intl402/Collator/prototype/compare/10.3.2_L15.js index 7f02924559..ab12bd28d4 100644 --- a/test/intl402/Collator/prototype/compare/10.3.2_L15.js +++ b/test/intl402/Collator/prototype/compare/10.3.2_L15.js @@ -8,7 +8,22 @@ description: > the requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get); +var compareFn = Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get; + +assert.sameValue(Object.prototype.toString.call(compareFn), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(compareFn), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(compareFn), Function.prototype); + +assert.sameValue(compareFn.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(compareFn), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Collator/prototype/resolvedOptions/10.3.3_L15.js b/test/intl402/Collator/prototype/resolvedOptions/10.3.3_L15.js index 51cfef46c4..cf83b0a628 100644 --- a/test/intl402/Collator/prototype/resolvedOptions/10.3.3_L15.js +++ b/test/intl402/Collator/prototype/resolvedOptions/10.3.3_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.Collator.prototype.resolvedOptions); +assert.sameValue(Object.prototype.toString.call(Intl.Collator.prototype.resolvedOptions), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.Collator.prototype.resolvedOptions), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.Collator.prototype.resolvedOptions), Function.prototype); + +assert.sameValue(Intl.Collator.prototype.resolvedOptions.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.Collator.prototype.resolvedOptions), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Collator/supportedLocalesOf/10.2.2_L15.js b/test/intl402/Collator/supportedLocalesOf/10.2.2_L15.js index 61e057c6ac..8fc4a24d46 100644 --- a/test/intl402/Collator/supportedLocalesOf/10.2.2_L15.js +++ b/test/intl402/Collator/supportedLocalesOf/10.2.2_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.Collator.supportedLocalesOf); +assert.sameValue(Object.prototype.toString.call(Intl.Collator.supportedLocalesOf), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.Collator.supportedLocalesOf), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.Collator.supportedLocalesOf), Function.prototype); + +assert.sameValue(Intl.Collator.supportedLocalesOf.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.Collator.supportedLocalesOf), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Date/prototype/toLocaleDateString/13.3.2_L15.js b/test/intl402/Date/prototype/toLocaleDateString/13.3.2_L15.js index c8c9a939da..70b8b9d796 100644 --- a/test/intl402/Date/prototype/toLocaleDateString/13.3.2_L15.js +++ b/test/intl402/Date/prototype/toLocaleDateString/13.3.2_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Date.prototype.toLocaleDateString); +assert.sameValue(Object.prototype.toString.call(Date.prototype.toLocaleDateString), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Date.prototype.toLocaleDateString), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Date.prototype.toLocaleDateString), Function.prototype); + +assert.sameValue(Date.prototype.toLocaleDateString.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Date.prototype.toLocaleDateString), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Date/prototype/toLocaleString/13.3.1_L15.js b/test/intl402/Date/prototype/toLocaleString/13.3.1_L15.js index d22b9ad9d1..dde2899d21 100644 --- a/test/intl402/Date/prototype/toLocaleString/13.3.1_L15.js +++ b/test/intl402/Date/prototype/toLocaleString/13.3.1_L15.js @@ -8,7 +8,20 @@ description: > for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Date.prototype.toLocaleString); +assert.sameValue(Object.prototype.toString.call(Date.prototype.toLocaleString), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Date.prototype.toLocaleString), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Date.prototype.toLocaleString), Function.prototype); + +assert.sameValue(Date.prototype.toLocaleString.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Date.prototype.toLocaleString), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Date/prototype/toLocaleTimeString/13.3.3_L15.js b/test/intl402/Date/prototype/toLocaleTimeString/13.3.3_L15.js index 4064f756d8..5e61e709d2 100644 --- a/test/intl402/Date/prototype/toLocaleTimeString/13.3.3_L15.js +++ b/test/intl402/Date/prototype/toLocaleTimeString/13.3.3_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Date.prototype.toLocaleTimeString); +assert.sameValue(Object.prototype.toString.call(Date.prototype.toLocaleTimeString), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Date.prototype.toLocaleTimeString), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Date.prototype.toLocaleTimeString), Function.prototype); + +assert.sameValue(Date.prototype.toLocaleTimeString.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Date.prototype.toLocaleTimeString), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/DateTimeFormat/prototype/format/12.3.2_1_a_L15.js b/test/intl402/DateTimeFormat/prototype/format/12.3.2_1_a_L15.js index 42facb22d1..4fa4f3e6b0 100644 --- a/test/intl402/DateTimeFormat/prototype/format/12.3.2_1_a_L15.js +++ b/test/intl402/DateTimeFormat/prototype/format/12.3.2_1_a_L15.js @@ -9,7 +9,22 @@ description: > built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(new Intl.DateTimeFormat().format); +var formatFn = new Intl.DateTimeFormat().format; + +assert.sameValue(Object.prototype.toString.call(formatFn), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(formatFn), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(formatFn), Function.prototype); + +assert.sameValue(formatFn.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(formatFn), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/DateTimeFormat/prototype/format/12.3.2_L15.js b/test/intl402/DateTimeFormat/prototype/format/12.3.2_L15.js index 280ca055f5..f0862c45c1 100644 --- a/test/intl402/DateTimeFormat/prototype/format/12.3.2_L15.js +++ b/test/intl402/DateTimeFormat/prototype/format/12.3.2_L15.js @@ -9,7 +9,22 @@ description: > introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get); +var formatFn = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get; + +assert.sameValue(Object.prototype.toString.call(formatFn), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(formatFn), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(formatFn), Function.prototype); + +assert.sameValue(formatFn.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(formatFn), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/DateTimeFormat/prototype/resolvedOptions/12.3.3_L15.js b/test/intl402/DateTimeFormat/prototype/resolvedOptions/12.3.3_L15.js index 8a9f5db478..db4e3b9f5b 100644 --- a/test/intl402/DateTimeFormat/prototype/resolvedOptions/12.3.3_L15.js +++ b/test/intl402/DateTimeFormat/prototype/resolvedOptions/12.3.3_L15.js @@ -8,7 +8,20 @@ description: > the requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.DateTimeFormat.prototype.resolvedOptions); +assert.sameValue(Object.prototype.toString.call(Intl.DateTimeFormat.prototype.resolvedOptions), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.DateTimeFormat.prototype.resolvedOptions), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.DateTimeFormat.prototype.resolvedOptions), Function.prototype); + +assert.sameValue(Intl.DateTimeFormat.prototype.resolvedOptions.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.DateTimeFormat.prototype.resolvedOptions), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/DateTimeFormat/supportedLocalesOf/12.2.2_L15.js b/test/intl402/DateTimeFormat/supportedLocalesOf/12.2.2_L15.js index 6ead0ebc8a..d67b64bfca 100644 --- a/test/intl402/DateTimeFormat/supportedLocalesOf/12.2.2_L15.js +++ b/test/intl402/DateTimeFormat/supportedLocalesOf/12.2.2_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.DateTimeFormat.supportedLocalesOf); +assert.sameValue(Object.prototype.toString.call(Intl.DateTimeFormat.supportedLocalesOf), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.DateTimeFormat.supportedLocalesOf), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.DateTimeFormat.supportedLocalesOf), Function.prototype); + +assert.sameValue(Intl.DateTimeFormat.supportedLocalesOf.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.DateTimeFormat.supportedLocalesOf), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/Number/prototype/toLocaleString/13.2.1_L15.js b/test/intl402/Number/prototype/toLocaleString/13.2.1_L15.js index 6858f76d26..5e5ece0f17 100644 --- a/test/intl402/Number/prototype/toLocaleString/13.2.1_L15.js +++ b/test/intl402/Number/prototype/toLocaleString/13.2.1_L15.js @@ -8,7 +8,20 @@ description: > for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Number.prototype.toLocaleString); +assert.sameValue(Object.prototype.toString.call(Number.prototype.toLocaleString), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Number.prototype.toLocaleString), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Number.prototype.toLocaleString), Function.prototype); + +assert.sameValue(Number.prototype.toLocaleString.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Number.prototype.toLocaleString), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/NumberFormat/prototype/format/11.3.2_1_a_L15.js b/test/intl402/NumberFormat/prototype/format/11.3.2_1_a_L15.js index 827b7d6fea..d7efa612a2 100644 --- a/test/intl402/NumberFormat/prototype/format/11.3.2_1_a_L15.js +++ b/test/intl402/NumberFormat/prototype/format/11.3.2_1_a_L15.js @@ -9,7 +9,22 @@ description: > built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(new Intl.NumberFormat().format); +var formatFn = new Intl.NumberFormat().format; + +assert.sameValue(Object.prototype.toString.call(formatFn), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(formatFn), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(formatFn), Function.prototype); + +assert.sameValue(formatFn.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(formatFn), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/NumberFormat/prototype/format/11.3.2_L15.js b/test/intl402/NumberFormat/prototype/format/11.3.2_L15.js index 8850dc0cb7..c89a62c6e5 100644 --- a/test/intl402/NumberFormat/prototype/format/11.3.2_L15.js +++ b/test/intl402/NumberFormat/prototype/format/11.3.2_L15.js @@ -9,7 +9,22 @@ description: > introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get); +var formatFn = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get; + +assert.sameValue(Object.prototype.toString.call(formatFn), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(formatFn), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(formatFn), Function.prototype); + +assert.sameValue(formatFn.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(formatFn), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/NumberFormat/prototype/resolvedOptions/11.3.3_L15.js b/test/intl402/NumberFormat/prototype/resolvedOptions/11.3.3_L15.js index 237aae7595..02c99d7349 100644 --- a/test/intl402/NumberFormat/prototype/resolvedOptions/11.3.3_L15.js +++ b/test/intl402/NumberFormat/prototype/resolvedOptions/11.3.3_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.NumberFormat.prototype.resolvedOptions); +assert.sameValue(Object.prototype.toString.call(Intl.NumberFormat.prototype.resolvedOptions), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.NumberFormat.prototype.resolvedOptions), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.NumberFormat.prototype.resolvedOptions), Function.prototype); + +assert.sameValue(Intl.NumberFormat.prototype.resolvedOptions.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.NumberFormat.prototype.resolvedOptions), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/NumberFormat/supportedLocalesOf/11.2.2_L15.js b/test/intl402/NumberFormat/supportedLocalesOf/11.2.2_L15.js index c3c362e56d..64a3869eaa 100644 --- a/test/intl402/NumberFormat/supportedLocalesOf/11.2.2_L15.js +++ b/test/intl402/NumberFormat/supportedLocalesOf/11.2.2_L15.js @@ -8,7 +8,20 @@ description: > requirements for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.NumberFormat.supportedLocalesOf); +assert.sameValue(Object.prototype.toString.call(Intl.NumberFormat.supportedLocalesOf), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.NumberFormat.supportedLocalesOf), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.NumberFormat.supportedLocalesOf), Function.prototype); + +assert.sameValue(Intl.NumberFormat.supportedLocalesOf.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.NumberFormat.supportedLocalesOf), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/PluralRules/prototype/resolvedOptions/builtins.js b/test/intl402/PluralRules/prototype/resolvedOptions/builtins.js index 2649acf106..e25ff3caa7 100644 --- a/test/intl402/PluralRules/prototype/resolvedOptions/builtins.js +++ b/test/intl402/PluralRules/prototype/resolvedOptions/builtins.js @@ -8,7 +8,20 @@ description: > built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Zibi Braniecki -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.PluralRules.prototype.resolvedOptions); +assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype.resolvedOptions), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.PluralRules.prototype.resolvedOptions), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.PluralRules.prototype.resolvedOptions), Function.prototype); + +assert.sameValue(Intl.PluralRules.prototype.resolvedOptions.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.PluralRules.prototype.resolvedOptions), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js b/test/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js index cbee32b4b3..ee6984f652 100644 --- a/test/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js +++ b/test/intl402/PluralRules/supportedLocalesOf/supportedLocalesOf.js @@ -8,7 +8,20 @@ description: > built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Zibi Braniecki -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(Intl.PluralRules.supportedLocalesOf); +assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.supportedLocalesOf), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(Intl.PluralRules.supportedLocalesOf), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(Intl.PluralRules.supportedLocalesOf), Function.prototype); + +assert.sameValue(Intl.PluralRules.supportedLocalesOf.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(Intl.PluralRules.supportedLocalesOf), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified."); diff --git a/test/intl402/String/prototype/localeCompare/13.1.1_L15.js b/test/intl402/String/prototype/localeCompare/13.1.1_L15.js index d7cfdff794..67db4ed5a3 100644 --- a/test/intl402/String/prototype/localeCompare/13.1.1_L15.js +++ b/test/intl402/String/prototype/localeCompare/13.1.1_L15.js @@ -8,7 +8,20 @@ description: > for built-in objects defined by the introduction of chapter 17 of the ECMAScript Language Specification. author: Norbert Lindenberg -includes: [testBuiltInObject.js] +includes: [isConstructor.js] ---*/ -testBuiltInObject(String.prototype.localeCompare); +assert.sameValue(Object.prototype.toString.call(String.prototype.localeCompare), "[object Function]", + "The [[Class]] internal property of a built-in function must be " + + "\"Function\"."); + +assert(Object.isExtensible(String.prototype.localeCompare), + "Built-in objects must be extensible."); + +assert.sameValue(Object.getPrototypeOf(String.prototype.localeCompare), Function.prototype); + +assert.sameValue(String.prototype.localeCompare.hasOwnProperty("prototype"), false, + "Built-in functions that aren't constructors must not have a prototype property."); + +assert.sameValue(isConstructor(String.prototype.localeCompare), false, + "Built-in functions don't implement [[Construct]] unless explicitly specified.");