Skip to content

Commit c84fed9

Browse files
committed
Add Intl.PluralRules tests
1 parent caa80c1 commit c84fed9

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-intl.pluralrules.prototype-tostringtag
6+
description: >
7+
Object.prototype.toString doesn't special-case neither Intl.PluralRules instances nor its prototype.
8+
info: |
9+
Object.prototype.toString ( )
10+
11+
[...]
12+
14. Else, let builtinTag be "Object".
13+
15. Let tag be ? Get(O, @@toStringTag).
14+
16. If Type(tag) is not String, set tag to builtinTag.
15+
17. Return the string-concatenation of "[object ", tag, and "]".
16+
features: [Symbol.toStringTag]
17+
---*/
18+
19+
delete Intl.PluralRules.prototype[Symbol.toStringTag];
20+
21+
assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Object]");
22+
assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object Object]");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-intl.pluralrules.prototype-tostringtag
6+
description: >
7+
Object.prototype.toString utilizes Intl.PluralRules.prototype[@@toStringTag].
8+
info: |
9+
Object.prototype.toString ( )
10+
11+
[...]
12+
14. Else, let builtinTag be "Object".
13+
15. Let tag be ? Get(O, @@toStringTag).
14+
16. If Type(tag) is not String, set tag to builtinTag.
15+
17. Return the string-concatenation of "[object ", tag, and "]".
16+
17+
Intl.PluralRules.prototype [ @@toStringTag ]
18+
19+
The initial value of the @@toStringTag property is the String value "Intl.PluralRules".
20+
features: [Symbol.toStringTag]
21+
---*/
22+
23+
assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Intl.PluralRules]");
24+
assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object Intl.PluralRules]");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
2+
// This code is governed by the BSD license found in the LICENSE file.
3+
4+
/*---
5+
esid: sec-intl.pluralrules.prototype-tostringtag
6+
description: >
7+
Property descriptor of Intl.PluralRules.prototype[@@toStringTag].
8+
info: |
9+
Intl.PluralRules.prototype [ @@toStringTag ]
10+
11+
The initial value of the @@toStringTag property is the String value "Intl.PluralRules".
12+
13+
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
14+
features: [Symbol.toStringTag]
15+
includes: [propertyHelper.js]
16+
---*/
17+
18+
verifyProperty(Intl.PluralRules.prototype, Symbol.toStringTag, {
19+
value: "Intl.PluralRules",
20+
writable: false,
21+
enumerable: false,
22+
configurable: true,
23+
});

0 commit comments

Comments
 (0)