-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2712 from shvaikalesh/intl402-intl-object-tostrin…
…gtag Add Intl[@@toStringTag] coverage
- Loading branch information
Showing
4 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2020 Alexey Shvayka. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl-toStringTag | ||
description: > | ||
Object.prototype.toString utilizes Intl[@@toStringTag] and doesn't special-case Intl namespace object. | ||
info: | | ||
Object.prototype.toString ( ) | ||
[...] | ||
14. Else, let builtinTag be "Object". | ||
15. Let tag be ? Get(O, @@toStringTag). | ||
16. If Type(tag) is not String, set tag to builtinTag. | ||
17. Return the string-concatenation of "[object ", tag, and "]". | ||
Intl [ @@toStringTag ] | ||
The initial value of the @@toStringTag property is the String value "Intl". | ||
features: [Symbol.toStringTag] | ||
---*/ | ||
|
||
assert.sameValue(Intl.toString(), "[object Intl]"); | ||
assert.sameValue(Object.prototype.toString.call(Intl), "[object Intl]"); | ||
|
||
Object.defineProperty(Intl, Symbol.toStringTag, { value: "test262" }); | ||
assert.sameValue(Intl.toString(), "[object test262]"); | ||
assert.sameValue(Object.prototype.toString.call(Intl), "[object test262]"); | ||
|
||
assert(delete Intl[Symbol.toStringTag]); | ||
assert.sameValue(Intl.toString(), "[object Object]"); | ||
assert.sameValue(Object.prototype.toString.call(Intl), "[object Object]"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (C) 2020 Alexey Shvayka. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-Intl-toStringTag | ||
description: > | ||
Property descriptor of Intl[@@toStringTag]. | ||
info: | | ||
Intl [ @@toStringTag ] | ||
The initial value of the @@toStringTag property is the String value "Intl". | ||
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. | ||
features: [Symbol.toStringTag] | ||
includes: [propertyHelper.js] | ||
---*/ | ||
|
||
verifyProperty(Intl, Symbol.toStringTag, { | ||
value: "Intl", | ||
writable: false, | ||
enumerable: false, | ||
configurable: true, | ||
}); |