mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
update tests
This commit is contained in:
parent
9f8ac1aace
commit
e687842030
26
test/intl402/DurationFormat/prototype/format/name.js
vendored
Normal file
26
test/intl402/DurationFormat/prototype/format/name.js
vendored
Normal file
@ -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.format
|
||||||
|
description: Checks the "name" property of Intl.DurationFormat.prototype.format().
|
||||||
|
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.format, "name", {
|
||||||
|
value: "format",
|
||||||
|
writable: false,
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
21
test/intl402/DurationFormat/prototype/format/prop-desc.js
vendored
Normal file
21
test/intl402/DurationFormat/prototype/format/prop-desc.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: Property descriptor of Intl.DurationFormat.prototype.format
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
typeof Intl.DurationFormat.prototype.format,
|
||||||
|
'function',
|
||||||
|
'`typeof Intl.DurationFormat.prototype.format` is `function`'
|
||||||
|
);
|
||||||
|
|
||||||
|
verifyProperty(Intl.DurationFormat.prototype, 'format', {
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
configurable: true,
|
||||||
|
});
|
21
test/intl402/DurationFormat/prototype/format/throw-invoked-as-func.js
vendored
Normal file
21
test/intl402/DurationFormat/prototype/format/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.format ( duration )
|
||||||
|
(...)
|
||||||
|
2. Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
|
||||||
|
features: [Intl.DurationFormat]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const df = new Intl.DurationFormat();
|
||||||
|
|
||||||
|
// Perform ? RequireInternalSlot(df, [[InitializedDurationFormat]]).
|
||||||
|
let f = df['format'];
|
||||||
|
|
||||||
|
assert.sameValue(typeof f, 'function');
|
||||||
|
assert.throws(TypeError, () => { f('PT12.3456S') });
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user