Skip to content

Commit e0ef80b

Browse files
authored
Merge pull request #2712 from shvaikalesh/intl402-intl-object-tostringtag
Add Intl[@@toStringTag] coverage
2 parents f6a9847 + c46be19 commit e0ef80b

File tree

4 files changed

+56
-15
lines changed

4 files changed

+56
-15
lines changed

test/intl402/Intl/builtin.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,14 @@
22
// This code is governed by the license found in the LICENSE file.
33

44
/*---
5-
es5id: 8.0_L15
5+
esid: intl-object
66
description: >
77
Tests that Intl meets the requirements for built-in objects
88
defined by the introduction of chapter 17 of the ECMAScript
99
Language Specification.
1010
author: Norbert Lindenberg
1111
---*/
1212

13-
assert.sameValue(Object.prototype.toString.call(Intl), "[object Object]",
14-
"The [[Class]] internal property of a built-in non-function object must be " +
15-
"\"Object\".");
16-
1713
assert(Object.isExtensible(Intl), "Built-in objects must be extensible.");
1814

1915
assert.sameValue(Object.getPrototypeOf(Intl), Object.prototype,

test/intl402/Intl/proto.js

-10
This file was deleted.
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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-toStringTag
6+
description: >
7+
Object.prototype.toString utilizes Intl[@@toStringTag] and doesn't special-case Intl namespace object.
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 [ @@toStringTag ]
18+
19+
The initial value of the @@toStringTag property is the String value "Intl".
20+
features: [Symbol.toStringTag]
21+
---*/
22+
23+
assert.sameValue(Intl.toString(), "[object Intl]");
24+
assert.sameValue(Object.prototype.toString.call(Intl), "[object Intl]");
25+
26+
Object.defineProperty(Intl, Symbol.toStringTag, { value: "test262" });
27+
assert.sameValue(Intl.toString(), "[object test262]");
28+
assert.sameValue(Object.prototype.toString.call(Intl), "[object test262]");
29+
30+
assert(delete Intl[Symbol.toStringTag]);
31+
assert.sameValue(Intl.toString(), "[object Object]");
32+
assert.sameValue(Object.prototype.toString.call(Intl), "[object Object]");
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-toStringTag
6+
description: >
7+
Property descriptor of Intl[@@toStringTag].
8+
info: |
9+
Intl [ @@toStringTag ]
10+
11+
The initial value of the @@toStringTag property is the String value "Intl".
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, Symbol.toStringTag, {
19+
value: "Intl",
20+
writable: false,
21+
enumerable: false,
22+
configurable: true,
23+
});

0 commit comments

Comments
 (0)