diff --git a/test/intl402/Intl/builtin.js b/test/intl402/Intl/builtin.js index e74fb94036..a4d4b56ec0 100644 --- a/test/intl402/Intl/builtin.js +++ b/test/intl402/Intl/builtin.js @@ -2,7 +2,7 @@ // 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 @@ -10,10 +10,6 @@ description: > 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, diff --git a/test/intl402/Intl/proto.js b/test/intl402/Intl/proto.js deleted file mode 100644 index 34fe92641c..0000000000 --- a/test/intl402/Intl/proto.js +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2013 Mozilla Corporation. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -es5id: 8.0 -description: Tests that Intl has Object.prototype as its prototype. -author: Norbert Lindenberg ----*/ - -assert.sameValue(Object.getPrototypeOf(Intl), Object.prototype, "Intl doesn't have Object.prototype as its prototype."); diff --git a/test/intl402/Intl/toStringTag/toString.js b/test/intl402/Intl/toStringTag/toString.js new file mode 100644 index 0000000000..8d77b36aa5 --- /dev/null +++ b/test/intl402/Intl/toStringTag/toString.js @@ -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]"); diff --git a/test/intl402/Intl/toStringTag/toStringTag.js b/test/intl402/Intl/toStringTag/toStringTag.js new file mode 100644 index 0000000000..2a764bad02 --- /dev/null +++ b/test/intl402/Intl/toStringTag/toStringTag.js @@ -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, +});