Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Intl[@@toStringTag] coverage #2712

Merged
merged 3 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions test/intl402/Intl/builtin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
// This code is governed by the license found in the LICENSE file.

/*---
es5id: 8.0_L15
esid: intl-object
description: >
Tests that Intl meets the requirements for built-in objects
defined by the introduction of chapter 17 of the ECMAScript
Language Specification.
author: Norbert Lindenberg
---*/

assert.sameValue(Object.prototype.toString.call(Intl), "[object Object]",
"The [[Class]] internal property of a built-in non-function object must be " +
"\"Object\".");

assert(Object.isExtensible(Intl), "Built-in objects must be extensible.");

assert.sameValue(Object.getPrototypeOf(Intl), Object.prototype,
Expand Down
10 changes: 0 additions & 10 deletions test/intl402/Intl/proto.js

This file was deleted.

32 changes: 32 additions & 0 deletions test/intl402/Intl/toStringTag/toString.js
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]");
23 changes: 23 additions & 0 deletions test/intl402/Intl/toStringTag/toStringTag.js
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,
});