test(Intl.DurationFormat.prototype): check prototype attributes

This commit is contained in:
Nikhil Singhal 2021-11-27 15:43:08 -08:00 committed by Rick Waldron
parent 4d23bbf00a
commit f00ea58ae9
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,15 @@
// Copyright (C) 2021 Nikhil Singhal. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.DurationFormat.prototype
description: Prototype attributes verification
info: |
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
features: [Intl.DurationFormat.prototype]
includes: [propertyHelper.js]
---*/
verifyNotEnumerable(Intl.DurationFormat, "prototype");
verifyNotWritable(Intl.DurationFormat, "prototype");
verifyNotConfigurable(Intl.DurationFormat, "prototype");

View File

@ -0,0 +1,30 @@
// Copyright (C) 2021 Nikhil Singhal. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.DurationFormat.prototype-@@tostringtag
description: Checks prototype's toStringTag value
info: |
The initial value of the @@toStringTag property is the string value "Intl.DurationFormat".
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
features: [Symbol.toStringTag]
includes: [propertyHelper.js]
---*/
assert.sameValue(
Object.prototype.toString.call(Intl.DurationFormat.prototype),
'[object Intl.DurationFormat]',
'prototype - Initial value of @@toStringTag is not Intl.DurationFormat',
);
assert.sameValue(
Object.prototype.toString.call(new Intl.DurationFormat()),
'[object Intl.DurationFormat]',
'new call - Initial value of @@toStringTag is not Intl.DurationFormat',
);
const durationFormat = new Intl.DurationFormat();
verifyNotEnumerable(durationFormat, Symbol.toStringTag);
verifyNotWritable(durationFormat, Symbol.toStringTag);
verifyConfigurable(durationFormat, Symbol.toStringTag);