mirror of https://github.com/tc39/test262.git
update tests
This commit is contained in:
parent
9f8ac1aace
commit
e687842030
|
@ -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
|
||||
});
|
|
@ -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,
|
||||
});
|
|
@ -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…
Reference in New Issue