mirror of https://github.com/tc39/test262.git
Add separate test files to test the length property of Intl functions
This commit is contained in:
parent
c2c274fe8a
commit
513a3056fb
|
@ -13,12 +13,10 @@ description: |
|
|||
* @param {boolean} isConstructor whether the specification describes obj as a constructor.
|
||||
* @param {String[]} properties an array with the names of the built-in properties of obj,
|
||||
* excluding length, prototype, or properties with non-default attributes.
|
||||
* @param {number} length for functions only: the length specified for the function
|
||||
* or derived from the argument list.
|
||||
* @author Norbert Lindenberg
|
||||
*/
|
||||
|
||||
function testBuiltInObject(obj, isFunction, isConstructor, properties, length) {
|
||||
function testBuiltInObject(obj, isFunction, isConstructor, properties) {
|
||||
|
||||
if (obj === undefined) {
|
||||
$ERROR("Object being tested is undefined.");
|
||||
|
@ -55,29 +53,6 @@ function testBuiltInObject(obj, isFunction, isConstructor, properties, length) {
|
|||
// verification of the absence of the prototype property has
|
||||
// been moved to the end of the test
|
||||
|
||||
if (isFunction) {
|
||||
|
||||
if (typeof obj.length !== "number" || obj.length !== Math.floor(obj.length)) {
|
||||
$ERROR("Built-in functions must have a length property with an integer value.");
|
||||
}
|
||||
|
||||
if (obj.length !== length) {
|
||||
$ERROR("Function's length property doesn't have specified value; expected " +
|
||||
length + ", got " + obj.length + ".");
|
||||
}
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, "length");
|
||||
if (desc.writable) {
|
||||
$ERROR("The length property of a built-in function must not be writable.");
|
||||
}
|
||||
if (desc.enumerable) {
|
||||
$ERROR("The length property of a built-in function must not be enumerable.");
|
||||
}
|
||||
if (!desc.configurable) {
|
||||
$ERROR("The length property of a built-in function must be configurable.");
|
||||
}
|
||||
}
|
||||
|
||||
properties.forEach(function(prop) {
|
||||
var desc = Object.getOwnPropertyDescriptor(obj, prop);
|
||||
if (desc === undefined) {
|
||||
|
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.Collator, true, true, ["supportedLocalesOf"], 0);
|
||||
testBuiltInObject(Intl.Collator, true, true, ["supportedLocalesOf"]);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.collator
|
||||
description: >
|
||||
Intl.Collator.length is 0.
|
||||
info: |
|
||||
Intl.Collator ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.Collator.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.Collator, "length");
|
||||
verifyNotWritable(Intl.Collator, "length");
|
||||
verifyConfigurable(Intl.Collator, "length");
|
|
@ -12,4 +12,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(new Intl.Collator().compare, true, false, [], 2);
|
||||
testBuiltInObject(new Intl.Collator().compare, true, false, []);
|
||||
|
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get , true, false, [], 0);
|
||||
testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare").get , true, false, []);
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.collator.prototype.compare
|
||||
description: >
|
||||
The length of the bound Collator compare function is 2.
|
||||
info: |
|
||||
get Intl.Collator.prototype.compare
|
||||
|
||||
...
|
||||
4. If collator.[[BoundCompare]] is undefined, then
|
||||
a. Let F be a new built-in function object as defined in 10.3.4.
|
||||
b. Let bc be BoundFunctionCreate(F, collator, « »).
|
||||
c. Perform ! DefinePropertyOrThrow(bc, "length", PropertyDescriptor {[[Value]]: 2,
|
||||
[[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
|
||||
...
|
||||
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var compareFn = new Intl.Collator().compare;
|
||||
|
||||
assert.sameValue(compareFn.length, 2);
|
||||
|
||||
verifyNotEnumerable(compareFn, "length");
|
||||
verifyNotWritable(compareFn, "length");
|
||||
verifyConfigurable(compareFn, "length");
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.collator.prototype.compare
|
||||
description: >
|
||||
get Intl.Collator.prototype.compare.length is 0.
|
||||
info: |
|
||||
get Intl.Collator.prototype.compare
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(Intl.Collator.prototype, "compare");
|
||||
|
||||
assert.sameValue(desc.get.length, 0);
|
||||
|
||||
verifyNotEnumerable(desc.get, "length");
|
||||
verifyNotWritable(desc.get, "length");
|
||||
verifyConfigurable(desc.get, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.Collator.prototype.resolvedOptions, true, false, [], 0);
|
||||
testBuiltInObject(Intl.Collator.prototype.resolvedOptions, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.collator.prototype.resolvedoptions
|
||||
description: >
|
||||
Intl.Collator.prototype.resolvedOptions.length is 0.
|
||||
info: |
|
||||
Intl.Collator.prototype.resolvedOptions ()
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.Collator.prototype.resolvedOptions.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.Collator.prototype.resolvedOptions, "length");
|
||||
verifyNotWritable(Intl.Collator.prototype.resolvedOptions, "length");
|
||||
verifyConfigurable(Intl.Collator.prototype.resolvedOptions, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.Collator.supportedLocalesOf, true, false, [], 1);
|
||||
testBuiltInObject(Intl.Collator.supportedLocalesOf, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.collator.supportedlocalesof
|
||||
description: >
|
||||
Intl.Collator.supportedLocalesOf.length is 1.
|
||||
info: |
|
||||
Intl.Collator.supportedLocalesOf ( locales [ , options ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.Collator.supportedLocalesOf.length, 1);
|
||||
|
||||
verifyNotEnumerable(Intl.Collator.supportedLocalesOf, "length");
|
||||
verifyNotWritable(Intl.Collator.supportedLocalesOf, "length");
|
||||
verifyConfigurable(Intl.Collator.supportedLocalesOf, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Date.prototype.toLocaleDateString, true, false, [], 0);
|
||||
testBuiltInObject(Date.prototype.toLocaleDateString, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-date.prototype.tolocaledatestring
|
||||
description: >
|
||||
Date.prototype.toLocaleDateString.length is 0.
|
||||
info: |
|
||||
Date.prototype.toLocaleDateString ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Date.prototype.toLocaleDateString.length, 0);
|
||||
|
||||
verifyNotEnumerable(Date.prototype.toLocaleDateString, "length");
|
||||
verifyNotWritable(Date.prototype.toLocaleDateString, "length");
|
||||
verifyConfigurable(Date.prototype.toLocaleDateString, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Date.prototype.toLocaleString, true, false, [], 0);
|
||||
testBuiltInObject(Date.prototype.toLocaleString, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-date.prototype.tolocalestring
|
||||
description: >
|
||||
Date.prototype.toLocaleString.length is 0.
|
||||
info: |
|
||||
Date.prototype.toLocaleString ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Date.prototype.toLocaleString.length, 0);
|
||||
|
||||
verifyNotEnumerable(Date.prototype.toLocaleString, "length");
|
||||
verifyNotWritable(Date.prototype.toLocaleString, "length");
|
||||
verifyConfigurable(Date.prototype.toLocaleString, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Date.prototype.toLocaleTimeString, true, false, [], 0);
|
||||
testBuiltInObject(Date.prototype.toLocaleTimeString, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-date.prototype.tolocaletimestring
|
||||
description: >
|
||||
Date.prototype.toLocaleTimeString.length is 0.
|
||||
info: |
|
||||
Date.prototype.toLocaleTimeString ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Date.prototype.toLocaleTimeString.length, 0);
|
||||
|
||||
verifyNotEnumerable(Date.prototype.toLocaleTimeString, "length");
|
||||
verifyNotWritable(Date.prototype.toLocaleTimeString, "length");
|
||||
verifyConfigurable(Date.prototype.toLocaleTimeString, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.DateTimeFormat, true, true, ["supportedLocalesOf"], 0);
|
||||
testBuiltInObject(Intl.DateTimeFormat, true, true, ["supportedLocalesOf"]);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.datetimeformat
|
||||
description: >
|
||||
Intl.DateTimeFormat.length is 0.
|
||||
info: |
|
||||
Intl.DateTimeFormat ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.DateTimeFormat.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.DateTimeFormat, "length");
|
||||
verifyNotWritable(Intl.DateTimeFormat, "length");
|
||||
verifyConfigurable(Intl.DateTimeFormat, "length");
|
|
@ -12,4 +12,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(new Intl.DateTimeFormat().format, true, false, [], 1);
|
||||
testBuiltInObject(new Intl.DateTimeFormat().format, true, false, []);
|
||||
|
|
|
@ -12,4 +12,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get , true, false, [], 0);
|
||||
testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format").get , true, false, []);
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.datetimeformat.prototype.format
|
||||
description: >
|
||||
The length of the bound DateTime Format function is 1.
|
||||
info: |
|
||||
get Intl.DateTimeFormat.prototype.format
|
||||
|
||||
...
|
||||
4. If dtf.[[BoundFormat]] is undefined, then
|
||||
a. Let F be a new built-in function object as defined in DateTime Format Functions (12.1.5).
|
||||
b. Let bf be BoundFunctionCreate(F, dft, « »).
|
||||
c. Perform ! DefinePropertyOrThrow(bf, "length", PropertyDescriptor {[[Value]]: 1,
|
||||
[[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
|
||||
...
|
||||
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var formatFn = new Intl.DateTimeFormat().format;
|
||||
|
||||
assert.sameValue(formatFn.length, 1);
|
||||
|
||||
verifyNotEnumerable(formatFn, "length");
|
||||
verifyNotWritable(formatFn, "length");
|
||||
verifyConfigurable(formatFn, "length");
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.datetimeformat.prototype.format
|
||||
description: >
|
||||
get Intl.DateTimeFormat.prototype.format.length is 0.
|
||||
info: |
|
||||
get Intl.DateTimeFormat.prototype.format
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype, "format");
|
||||
|
||||
assert.sameValue(desc.get.length, 0);
|
||||
|
||||
verifyNotEnumerable(desc.get, "length");
|
||||
verifyNotWritable(desc.get, "length");
|
||||
verifyConfigurable(desc.get, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.DateTimeFormat.prototype.resolvedOptions, true, false, [], 0);
|
||||
testBuiltInObject(Intl.DateTimeFormat.prototype.resolvedOptions, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.datetimeformat.prototype.resolvedoptions
|
||||
description: >
|
||||
Intl.DateTimeFormat.prototype.resolvedOptions.length is 0.
|
||||
info: |
|
||||
Intl.DateTimeFormat.prototype.resolvedOptions ()
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.DateTimeFormat.prototype.resolvedOptions.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.DateTimeFormat.prototype.resolvedOptions, "length");
|
||||
verifyNotWritable(Intl.DateTimeFormat.prototype.resolvedOptions, "length");
|
||||
verifyConfigurable(Intl.DateTimeFormat.prototype.resolvedOptions, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.DateTimeFormat.supportedLocalesOf, true, false, [], 1);
|
||||
testBuiltInObject(Intl.DateTimeFormat.supportedLocalesOf, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.datetimeformat.supportedlocalesof
|
||||
description: >
|
||||
Intl.DateTimeFormat.supportedLocalesOf.length is 1.
|
||||
info: |
|
||||
Intl.DateTimeFormat.supportedLocalesOf ( locales [ , options ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.DateTimeFormat.supportedLocalesOf.length, 1);
|
||||
|
||||
verifyNotEnumerable(Intl.DateTimeFormat.supportedLocalesOf, "length");
|
||||
verifyNotWritable(Intl.DateTimeFormat.supportedLocalesOf, "length");
|
||||
verifyConfigurable(Intl.DateTimeFormat.supportedLocalesOf, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Number.prototype.toLocaleString, true, false, [], 0);
|
||||
testBuiltInObject(Number.prototype.toLocaleString, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-number.prototype.tolocalestring
|
||||
description: >
|
||||
Number.prototype.toLocaleString.length is 0.
|
||||
info: |
|
||||
Number.prototype.toLocaleString ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Number.prototype.toLocaleString.length, 0);
|
||||
|
||||
verifyNotEnumerable(Number.prototype.toLocaleString, "length");
|
||||
verifyNotWritable(Number.prototype.toLocaleString, "length");
|
||||
verifyConfigurable(Number.prototype.toLocaleString, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.NumberFormat, true, true, ["supportedLocalesOf"], 0);
|
||||
testBuiltInObject(Intl.NumberFormat, true, true, ["supportedLocalesOf"]);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.numberformat
|
||||
description: >
|
||||
Intl.NumberFormat.length is 0.
|
||||
info: |
|
||||
Intl.NumberFormat ( [ locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.NumberFormat.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.NumberFormat, "length");
|
||||
verifyNotWritable(Intl.NumberFormat, "length");
|
||||
verifyConfigurable(Intl.NumberFormat, "length");
|
|
@ -12,4 +12,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(new Intl.NumberFormat().format, true, false, [], 1);
|
||||
testBuiltInObject(new Intl.NumberFormat().format, true, false, []);
|
||||
|
|
|
@ -12,4 +12,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get , true, false, [], 0);
|
||||
testBuiltInObject(Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format").get , true, false, []);
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.numberformat.prototype.format
|
||||
description: >
|
||||
The length of the bound Number Format function is 1.
|
||||
info: |
|
||||
get Intl.NumberFormat.prototype.format
|
||||
|
||||
...
|
||||
4. If nf.[[BoundFormat]] is undefined, then
|
||||
a. Let F be a new built-in function object as defined in Number Format Functions (11.1.4).
|
||||
b. Let bf be BoundFunctionCreate(F, nf, « »).
|
||||
c. Perform ! DefinePropertyOrThrow(bf, "length", PropertyDescriptor {[[Value]]: 1,
|
||||
[[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).
|
||||
...
|
||||
|
||||
includes: [propertyHelper.js]
|
||||
---*/
|
||||
|
||||
var formatFn = new Intl.NumberFormat().format;
|
||||
|
||||
assert.sameValue(formatFn.length, 1);
|
||||
|
||||
verifyNotEnumerable(formatFn, "length");
|
||||
verifyNotWritable(formatFn, "length");
|
||||
verifyConfigurable(formatFn, "length");
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.numberformat.prototype.format
|
||||
description: >
|
||||
get Intl.NumberFormat.prototype.format.length is 0.
|
||||
info: |
|
||||
get Intl.NumberFormat.prototype.format
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
var desc = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype, "format");
|
||||
|
||||
assert.sameValue(desc.get.length, 0);
|
||||
|
||||
verifyNotEnumerable(desc.get, "length");
|
||||
verifyNotWritable(desc.get, "length");
|
||||
verifyConfigurable(desc.get, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.NumberFormat.prototype.resolvedOptions, true, false, [], 0);
|
||||
testBuiltInObject(Intl.NumberFormat.prototype.resolvedOptions, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.numberformat.prototype.resolvedoptions
|
||||
description: >
|
||||
Intl.NumberFormat.prototype.resolvedOptions.length is 0.
|
||||
info: |
|
||||
Intl.NumberFormat.prototype.resolvedOptions ()
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.NumberFormat.prototype.resolvedOptions.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.NumberFormat.prototype.resolvedOptions, "length");
|
||||
verifyNotWritable(Intl.NumberFormat.prototype.resolvedOptions, "length");
|
||||
verifyConfigurable(Intl.NumberFormat.prototype.resolvedOptions, "length");
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.NumberFormat.supportedLocalesOf, true, false, [], 1);
|
||||
testBuiltInObject(Intl.NumberFormat.supportedLocalesOf, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.numberformat.supportedlocalesof
|
||||
description: >
|
||||
Intl.NumberFormat.supportedLocalesOf.length is 1.
|
||||
info: |
|
||||
Intl.NumberFormat.supportedLocalesOf ( locales [ , options ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.NumberFormat.supportedLocalesOf.length, 1);
|
||||
|
||||
verifyNotEnumerable(Intl.NumberFormat.supportedLocalesOf, "length");
|
||||
verifyNotWritable(Intl.NumberFormat.supportedLocalesOf, "length");
|
||||
verifyConfigurable(Intl.NumberFormat.supportedLocalesOf, "length");
|
|
@ -11,4 +11,4 @@ author: Zibi Braniecki
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.PluralRules, true, true, ["supportedLocalesOf"], 0);
|
||||
testBuiltInObject(Intl.PluralRules, true, true, ["supportedLocalesOf"]);
|
||||
|
|
|
@ -11,4 +11,4 @@ author: Zibi Braniecki
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.PluralRules.prototype.resolvedOptions, true, false, [], 0);
|
||||
testBuiltInObject(Intl.PluralRules.prototype.resolvedOptions, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.pluralrules.prototype.resolvedoptions
|
||||
description: >
|
||||
Intl.PluralRules.prototype.resolvedOptions.length is 0.
|
||||
info: |
|
||||
Intl.PluralRules.prototype.resolvedOptions ()
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.PluralRules.prototype.resolvedOptions.length, 0);
|
||||
|
||||
verifyNotEnumerable(Intl.PluralRules.prototype.resolvedOptions, "length");
|
||||
verifyNotWritable(Intl.PluralRules.prototype.resolvedOptions, "length");
|
||||
verifyConfigurable(Intl.PluralRules.prototype.resolvedOptions, "length");
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.pluralrules.prototype.select
|
||||
description: >
|
||||
Intl.PluralRules.prototype.select is 1.
|
||||
info: |
|
||||
Intl.PluralRules.prototype.select( value )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.PluralRules.prototype.select.length, 1);
|
||||
|
||||
verifyNotEnumerable(Intl.PluralRules.prototype.select, "length");
|
||||
verifyNotWritable(Intl.PluralRules.prototype.select, "length");
|
||||
verifyConfigurable(Intl.PluralRules.prototype.select, "length");
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-intl.pluralrules.supportedlocalesof
|
||||
description: >
|
||||
Intl.PluralRules.supportedLocalesOf.length is 1.
|
||||
info: |
|
||||
Intl.PluralRules.supportedLocalesOf ( locales [ , options ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(Intl.PluralRules.supportedLocalesOf.length, 1);
|
||||
|
||||
verifyNotEnumerable(Intl.PluralRules.supportedLocalesOf, "length");
|
||||
verifyNotWritable(Intl.PluralRules.supportedLocalesOf, "length");
|
||||
verifyConfigurable(Intl.PluralRules.supportedLocalesOf, "length");
|
|
@ -11,4 +11,4 @@ author: Zibi Braniecki
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(Intl.PluralRules.supportedLocalesOf, true, false, [], 1);
|
||||
testBuiltInObject(Intl.PluralRules.supportedLocalesOf, true, false, []);
|
||||
|
|
|
@ -11,4 +11,4 @@ author: Norbert Lindenberg
|
|||
includes: [testBuiltInObject.js]
|
||||
---*/
|
||||
|
||||
testBuiltInObject(String.prototype.localeCompare, true, false, [], 1);
|
||||
testBuiltInObject(String.prototype.localeCompare, true, false, []);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (C) 2017 André Bargull. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sup-String.prototype.localeCompare
|
||||
description: >
|
||||
String.prototype.localeCompare.length is 1.
|
||||
info: |
|
||||
String.prototype.localeCompare ( that [ , locales [ , options ] ] )
|
||||
|
||||
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. 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]
|
||||
---*/
|
||||
|
||||
assert.sameValue(String.prototype.localeCompare.length, 1);
|
||||
|
||||
verifyNotEnumerable(String.prototype.localeCompare, "length");
|
||||
verifyNotWritable(String.prototype.localeCompare, "length");
|
||||
verifyConfigurable(String.prototype.localeCompare, "length");
|
Loading…
Reference in New Issue