mirror of https://github.com/tc39/test262.git
update test
This commit is contained in:
parent
e687842030
commit
66f4071495
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-intl.datetimeformat.prototype.format
|
||||||
|
description: >
|
||||||
|
Intl.DateTimeFormat.prototype.format.length is 1.
|
||||||
|
info: |
|
||||||
|
Intl.DurationFormat.prototype.format ( duration )
|
||||||
|
|
||||||
|
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.format.length, 1);
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype.format, "length", {
|
||||||
|
value: 1,
|
||||||
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-intl.datetimeformat.prototype.formatToParts
|
||||||
|
description: >
|
||||||
|
Intl.DateTimeFormat.prototype.formatToParts.length is 1.
|
||||||
|
info: |
|
||||||
|
Intl.DateTimeFormat.prototype.formatToParts ( date )
|
||||||
|
|
||||||
|
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.formatToParts.length, 1);
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype.formatToParts, "length", {
|
||||||
|
value: 1,
|
||||||
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-Intl.DurationFormat.prototype.formatToParts
|
||||||
|
description: Checks the "name" property of Intl.DurationFormat.prototype.formatToParts().
|
||||||
|
info: |
|
||||||
|
17 ECMAScript Standard Built-in Objects:
|
||||||
|
Every built-in Function object, including constructors, that is not
|
||||||
|
identified as an anonymous function has a name property whose value
|
||||||
|
is a String.
|
||||||
|
|
||||||
|
Unless otherwise specified, the name property of a built-in Function
|
||||||
|
object, if it exists, has the attributes { [[Writable]]: false,
|
||||||
|
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||||
|
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype.formatToParts, "name", {
|
||||||
|
value: "formatToParts",
|
||||||
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-Intl.DurationFormat.prototype.formatToParts
|
||||||
|
description: Property descriptor of Intl.DurationFormat.prototype.formatToParts
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
typeof Intl.DurationFormat.prototype.formatToParts,
|
||||||
|
'function',
|
||||||
|
'`typeof Intl.DurationFormat.prototype.formatToParts` is `function`'
|
||||||
|
);
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype, 'formatToParts', {
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
configurable: true,
|
||||||
|
});
|
21
test/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js
vendored
Normal file
21
test/intl402/DurationFormat/prototype/formatToParts/throw-invoked-as-func.js
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-intl.DurationFormat.prototype.format
|
||||||
|
description: basic tests internal slot initialization and call receiver errors
|
||||||
|
info: |
|
||||||
|
Intl.DurationFormat.prototype.formatToParts ( duration )
|
||||||
|
(...)
|
||||||
|
2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const df = new Intl.DurationFormat();
|
||||||
|
|
||||||
|
// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
|
||||||
|
let f = df['formatToParts'];
|
||||||
|
|
||||||
|
assert.sameValue(typeof f, 'function');
|
||||||
|
assert.throws(TypeError, () => { f('PT12.3456S') });
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-intl.DurationFormat.prototype.resolvedoptions
|
||||||
|
description: >
|
||||||
|
Intl.DurationFormat.prototype.resolvedOptions.length is 0.
|
||||||
|
info: |
|
||||||
|
Intl.DurationFormat.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.DurationFormat.prototype.resolvedOptions.length, 0);
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype.resolvedOptions, "length", {
|
||||||
|
value: 0,
|
||||||
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-Intl.DurationFormat.prototype.resolvedOptions
|
||||||
|
description: Checks the "name" property of Intl.DurationFormat.prototype.resolvedOptions().
|
||||||
|
info: |
|
||||||
|
17 ECMAScript Standard Built-in Objects:
|
||||||
|
Every built-in Function object, including constructors, that is not
|
||||||
|
identified as an anonymous function has a name property whose value
|
||||||
|
is a String.
|
||||||
|
|
||||||
|
Unless otherwise specified, the name property of a built-in Function
|
||||||
|
object, if it exists, has the attributes { [[Writable]]: false,
|
||||||
|
[[Enumerable]]: false, [[Configurable]]: true }.
|
||||||
|
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype.resolvedOptions, "name", {
|
||||||
|
value: "resolvedOptions",
|
||||||
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-Intl.DurationFormat.prototype.resolvedOptions
|
||||||
|
description: Property descriptor of Intl.DurationFormat.prototype.resolvedOptions
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
typeof Intl.DurationFormat.prototype.resolvedOptions,
|
||||||
|
'function',
|
||||||
|
'`typeof Intl.DurationFormat.prototype.resolvedOptions` is `function`'
|
||||||
|
);
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype, 'resolvedOptions', {
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
configurable: true,
|
||||||
|
});
|
21
test/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js
vendored
Normal file
21
test/intl402/DurationFormat/prototype/resolvedOptions/throw-invoked-as-func.js
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-intl.DurationFormat.prototype.resolvedOptions
|
||||||
|
description: basic tests internal slot initialization and call receiver errors
|
||||||
|
info: |
|
||||||
|
Intl.DurationFormat.prototype.resolvedOptions ( )
|
||||||
|
(...)
|
||||||
|
2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const df = new Intl.DurationFormat();
|
||||||
|
|
||||||
|
// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
|
||||||
|
let f = df['resolvedOptions'];
|
||||||
|
|
||||||
|
assert.sameValue(typeof f, 'function');
|
||||||
|
assert.throws(TypeError, () => { f() });
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-intl.DurationFormat.prototype-@@tostringtag
|
||||||
|
description: >
|
||||||
|
Object.prototype.toString utilizes Intl.DurationFormat.prototype[@@toStringTag].
|
||||||
|
info: |
|
||||||
|
Intl.DurationFormat.prototype [ @@toStringTag ]
|
||||||
|
|
||||||
|
The initial value of the @@toStringTag property is the string value "Intl.DurationFormat".
|
||||||
|
|
||||||
|
features: [Intl.DurationFormat, Symbol.toStringTag]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(Object.prototype.toString.call(Intl.DurationFormat.prototype), "[object Intl.DurationFormat]");
|
||||||
|
assert.sameValue(Object.prototype.toString.call(new Intl.DurationFormat()), "[object Intl.DurationFormat]");
|
|
@ -1,12 +1,18 @@
|
||||||
// Copyright (C) 2021 Nikhil Singhal. All rights reserved.
|
// Copyright (C) 2021 Nikhil Singhal. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
// Copyright 2022 Igalia, S.L. All rights reserved.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-Intl.DurationFormat.prototype-@@tostringtag
|
esid: sec-intl.DurationFormat.prototype-@@tostringtag
|
||||||
description: Checks prototype's toStringTag value
|
description: >
|
||||||
|
Property descriptor of Intl.DurationFormat.prototype[@@toStringTag].
|
||||||
info: |
|
info: |
|
||||||
|
Intl.DurationFormat.prototype [ @@toStringTag ]
|
||||||
|
|
||||||
The initial value of the @@toStringTag property is the string value "Intl.DurationFormat".
|
The initial value of the @@toStringTag property is the string value "Intl.DurationFormat".
|
||||||
|
|
||||||
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
|
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
|
||||||
|
|
||||||
features: [Intl.DurationFormat, Symbol.toStringTag]
|
features: [Intl.DurationFormat, Symbol.toStringTag]
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
---*/
|
---*/
|
Loading…
Reference in New Issue