diff --git a/test/intl402/Collator/instance-class.js b/test/intl402/Collator/instance-class.js deleted file mode 100644 index 37b9751304..0000000000 --- a/test/intl402/Collator/instance-class.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2012 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 10.4_a -description: Tests that Intl.Collator instances have the specified properties. -author: Norbert Lindenberg ----*/ - -var obj = new Intl.Collator(); - -var toStringValue = Object.prototype.toString.call(obj); -assert.sameValue(toStringValue, "[object Object]", "Intl.Collator instance produces wrong [[Class]] - toString returns " + toStringValue + "."); diff --git a/test/intl402/Collator/prototype/builtin.js b/test/intl402/Collator/prototype/builtin.js index bbc0450f4b..af9251f32f 100644 --- a/test/intl402/Collator/prototype/builtin.js +++ b/test/intl402/Collator/prototype/builtin.js @@ -10,10 +10,6 @@ description: > author: Norbert Lindenberg ---*/ -assert.sameValue(Object.prototype.toString.call(Intl.Collator.prototype), "[object Object]", - "The [[Class]] internal property of a built-in non-function object must be " + - "\"Object\"."); - assert(Object.isExtensible(Intl.Collator.prototype), "Built-in objects must be extensible."); assert.sameValue(Object.getPrototypeOf(Intl.Collator.prototype), Object.prototype, diff --git a/test/intl402/Collator/prototype/toStringTag/toString-changed-tag.js b/test/intl402/Collator/prototype/toStringTag/toString-changed-tag.js new file mode 100644 index 0000000000..e1f3967e90 --- /dev/null +++ b/test/intl402/Collator/prototype/toStringTag/toString-changed-tag.js @@ -0,0 +1,28 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.collator.prototype-@@tostringtag +description: > + Object.prototype.toString utilizes Intl.Collator.prototype[@@toStringTag]. +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.Collator.prototype [ @@toStringTag ] + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.toStringTag] +---*/ + +Object.defineProperty(Intl.Collator.prototype, Symbol.toStringTag, { + value: "test262", +}); + +assert.sameValue(Object.prototype.toString.call(Intl.Collator.prototype), "[object test262]"); +assert.sameValue(Object.prototype.toString.call(new Intl.Collator()), "[object test262]"); diff --git a/test/intl402/Collator/prototype/toStringTag/toString-removed-tag.js b/test/intl402/Collator/prototype/toStringTag/toString-removed-tag.js new file mode 100644 index 0000000000..2c32d55f1a --- /dev/null +++ b/test/intl402/Collator/prototype/toStringTag/toString-removed-tag.js @@ -0,0 +1,22 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.collator.prototype-@@tostringtag +description: > + Object.prototype.toString doesn't special-case neither Intl.Collator instances nor its prototype. +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 "]". +features: [Symbol.toStringTag] +---*/ + +delete Intl.Collator.prototype[Symbol.toStringTag]; + +assert.sameValue(Object.prototype.toString.call(Intl.Collator.prototype), "[object Object]"); +assert.sameValue(Object.prototype.toString.call(new Intl.Collator()), "[object Object]"); diff --git a/test/intl402/Collator/prototype/toStringTag/toString.js b/test/intl402/Collator/prototype/toStringTag/toString.js new file mode 100644 index 0000000000..4ebdbdeaec --- /dev/null +++ b/test/intl402/Collator/prototype/toStringTag/toString.js @@ -0,0 +1,24 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.collator.prototype-@@tostringtag +description: > + Object.prototype.toString utilizes Intl.Collator.prototype[@@toStringTag]. +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.Collator.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the String value "Intl.Collator". +features: [Symbol.toStringTag] +---*/ + +assert.sameValue(Object.prototype.toString.call(Intl.Collator.prototype), "[object Intl.Collator]"); +assert.sameValue(Object.prototype.toString.call(new Intl.Collator()), "[object Intl.Collator]"); diff --git a/test/intl402/Collator/prototype/toStringTag/toStringTag.js b/test/intl402/Collator/prototype/toStringTag/toStringTag.js new file mode 100644 index 0000000000..6c8dc2c450 --- /dev/null +++ b/test/intl402/Collator/prototype/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.collator.prototype-@@tostringtag +description: > + Property descriptor of Intl.Collator.prototype[@@toStringTag]. +info: | + Intl.Collator.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the String value "Intl.Collator". + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.toStringTag] +includes: [propertyHelper.js] +---*/ + +verifyProperty(Intl.Collator.prototype, Symbol.toStringTag, { + value: "Intl.Collator", + writable: false, + enumerable: false, + configurable: true, +}); diff --git a/test/intl402/DateTimeFormat/instance-class.js b/test/intl402/DateTimeFormat/instance-class.js deleted file mode 100644 index 4b2088b514..0000000000 --- a/test/intl402/DateTimeFormat/instance-class.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 12.4_a -description: > - Tests that Intl.DateTimeFormat instances have the specified - properties. -author: Norbert Lindenberg ----*/ - -var obj = new Intl.DateTimeFormat(); - -var toStringValue = Object.prototype.toString.call(obj); -assert.sameValue(toStringValue, "[object Object]", "Intl.DateTimeFormat instance produces wrong [[Class]] - toString returns " + toStringValue + "."); diff --git a/test/intl402/DateTimeFormat/prototype/builtin.js b/test/intl402/DateTimeFormat/prototype/builtin.js index d38b8d7a03..ce5806f9cd 100644 --- a/test/intl402/DateTimeFormat/prototype/builtin.js +++ b/test/intl402/DateTimeFormat/prototype/builtin.js @@ -10,10 +10,6 @@ description: > author: Norbert Lindenberg ---*/ -assert.sameValue(Object.prototype.toString.call(Intl.DateTimeFormat.prototype), "[object Object]", - "The [[Class]] internal property of a built-in non-function object must be " + - "\"Object\"."); - assert(Object.isExtensible(Intl.DateTimeFormat.prototype), "Built-in objects must be extensible."); assert.sameValue(Object.getPrototypeOf(Intl.DateTimeFormat.prototype), Object.prototype, diff --git a/test/intl402/DateTimeFormat/prototype/toStringTag/toString-changed-tag.js b/test/intl402/DateTimeFormat/prototype/toStringTag/toString-changed-tag.js new file mode 100644 index 0000000000..d10575a702 --- /dev/null +++ b/test/intl402/DateTimeFormat/prototype/toStringTag/toString-changed-tag.js @@ -0,0 +1,28 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.datetimeformat.prototype-@@tostringtag +description: > + Object.prototype.toString utilizes Intl.DateTimeFormat.prototype[@@toStringTag]. +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.DateTimeFormat.prototype [ @@toStringTag ] + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.toStringTag] +---*/ + +Object.defineProperty(Intl.DateTimeFormat.prototype, Symbol.toStringTag, { + value: "test262", +}); + +assert.sameValue(Object.prototype.toString.call(Intl.DateTimeFormat.prototype), "[object test262]"); +assert.sameValue(Object.prototype.toString.call(new Intl.DateTimeFormat()), "[object test262]"); diff --git a/test/intl402/DateTimeFormat/prototype/toStringTag/toString-removed-tag.js b/test/intl402/DateTimeFormat/prototype/toStringTag/toString-removed-tag.js new file mode 100644 index 0000000000..1f008f2f9a --- /dev/null +++ b/test/intl402/DateTimeFormat/prototype/toStringTag/toString-removed-tag.js @@ -0,0 +1,22 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.datetimeformat.prototype-@@tostringtag +description: > + Object.prototype.toString doesn't special-case neither Intl.DateTimeFormat instances nor its prototype. +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 "]". +features: [Symbol.toStringTag] +---*/ + +delete Intl.DateTimeFormat.prototype[Symbol.toStringTag]; + +assert.sameValue(Object.prototype.toString.call(Intl.DateTimeFormat.prototype), "[object Object]"); +assert.sameValue(Object.prototype.toString.call(new Intl.DateTimeFormat()), "[object Object]"); diff --git a/test/intl402/DateTimeFormat/prototype/toStringTag/toString.js b/test/intl402/DateTimeFormat/prototype/toStringTag/toString.js new file mode 100644 index 0000000000..e63affc7cc --- /dev/null +++ b/test/intl402/DateTimeFormat/prototype/toStringTag/toString.js @@ -0,0 +1,24 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.datetimeformat.prototype-@@tostringtag +description: > + Object.prototype.toString utilizes Intl.DateTimeFormat.prototype[@@toStringTag]. +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.DateTimeFormat.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the String value "Intl.DateTimeFormat". +features: [Symbol.toStringTag] +---*/ + +assert.sameValue(Object.prototype.toString.call(Intl.DateTimeFormat.prototype), "[object Intl.DateTimeFormat]"); +assert.sameValue(Object.prototype.toString.call(new Intl.DateTimeFormat()), "[object Intl.DateTimeFormat]"); diff --git a/test/intl402/DateTimeFormat/prototype/toStringTag/toStringTag.js b/test/intl402/DateTimeFormat/prototype/toStringTag/toStringTag.js new file mode 100644 index 0000000000..9d7d856d37 --- /dev/null +++ b/test/intl402/DateTimeFormat/prototype/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.datetimeformat.prototype-@@tostringtag +description: > + Property descriptor of Intl.DateTimeFormat.prototype[@@toStringTag]. +info: | + Intl.DateTimeFormat.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the String value "Intl.DateTimeFormat". + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.toStringTag] +includes: [propertyHelper.js] +---*/ + +verifyProperty(Intl.DateTimeFormat.prototype, Symbol.toStringTag, { + value: "Intl.DateTimeFormat", + writable: false, + enumerable: false, + configurable: true, +}); diff --git a/test/intl402/NumberFormat/instance-class.js b/test/intl402/NumberFormat/instance-class.js deleted file mode 100644 index 3cb2e22a40..0000000000 --- a/test/intl402/NumberFormat/instance-class.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2012 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.4_a -description: > - Tests that Intl.NumberFormat instances have the specified - properties. -author: Norbert Lindenberg ----*/ - -var obj = new Intl.NumberFormat(); - -var toStringValue = Object.prototype.toString.call(obj); -assert.sameValue(toStringValue, "[object Object]", "Intl.NumberFormat instance produces wrong [[Class]] - toString returns " + toStringValue + "."); diff --git a/test/intl402/NumberFormat/prototype/builtin.js b/test/intl402/NumberFormat/prototype/builtin.js index b533647817..3a3e449c62 100644 --- a/test/intl402/NumberFormat/prototype/builtin.js +++ b/test/intl402/NumberFormat/prototype/builtin.js @@ -10,10 +10,6 @@ description: > author: Norbert Lindenberg ---*/ -assert.sameValue(Object.prototype.toString.call(Intl.NumberFormat.prototype), "[object Object]", - "The [[Class]] internal property of a built-in non-function object must be " + - "\"Object\"."); - assert(Object.isExtensible(Intl.NumberFormat.prototype), "Built-in objects must be extensible."); assert.sameValue(Object.getPrototypeOf(Intl.NumberFormat.prototype), Object.prototype, diff --git a/test/intl402/NumberFormat/prototype/toStringTag/configurable.js b/test/intl402/NumberFormat/prototype/toStringTag/configurable.js index 0e022fb2b2..ce03e00435 100644 --- a/test/intl402/NumberFormat/prototype/toStringTag/configurable.js +++ b/test/intl402/NumberFormat/prototype/toStringTag/configurable.js @@ -4,14 +4,14 @@ /*--- esid: sec-intl.numberformat.prototype-@@tostringtag description: > - Check that the initial value of the property is "Object" and that any changes + Check that the initial value of the property is "Intl.NumberFormat" and that any changes made by reconfiguring are reflected. ---*/ -assert.sameValue(Intl.NumberFormat.prototype[Symbol.toStringTag], 'Object'); +assert.sameValue(Intl.NumberFormat.prototype[Symbol.toStringTag], 'Intl.NumberFormat'); assert.sameValue( Object.prototype.toString.call(new Intl.NumberFormat()), - '[object Object]' + '[object Intl.NumberFormat]' ); Object.defineProperty(Intl.NumberFormat.prototype, Symbol.toStringTag, { @@ -23,3 +23,11 @@ assert.sameValue( Object.prototype.toString.call(new Intl.NumberFormat()), '[object Alpha]' ); + +delete Intl.NumberFormat.prototype[Symbol.toStringTag]; + +assert.sameValue(Intl.NumberFormat.prototype[Symbol.toStringTag], undefined); +assert.sameValue( + Object.prototype.toString.call(new Intl.NumberFormat()), + '[object Object]' +); diff --git a/test/intl402/NumberFormat/prototype/toStringTag/prop-desc.js b/test/intl402/NumberFormat/prototype/toStringTag/prop-desc.js index 73bfc6daae..a7195beefc 100644 --- a/test/intl402/NumberFormat/prototype/toStringTag/prop-desc.js +++ b/test/intl402/NumberFormat/prototype/toStringTag/prop-desc.js @@ -9,7 +9,7 @@ includes: [propertyHelper.js] ---*/ verifyProperty(Intl.NumberFormat.prototype, Symbol.toStringTag, { - value: 'Object', + value: 'Intl.NumberFormat', writable: false, enumerable: false, configurable: true diff --git a/test/intl402/PluralRules/prototype/builtins.js b/test/intl402/PluralRules/prototype/builtins.js index 83ae26031e..1fe5255ce3 100644 --- a/test/intl402/PluralRules/prototype/builtins.js +++ b/test/intl402/PluralRules/prototype/builtins.js @@ -10,10 +10,6 @@ description: > author: Zibi Braniecki ---*/ -assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Object]", - "The [[Class]] internal property of a built-in non-function object must be " + - "\"Object\"."); - assert(Object.isExtensible(Intl.PluralRules.prototype), "Built-in objects must be extensible."); assert.sameValue(Object.getPrototypeOf(Intl.PluralRules.prototype), Object.prototype, diff --git a/test/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js b/test/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js new file mode 100644 index 0000000000..ea738e63db --- /dev/null +++ b/test/intl402/PluralRules/prototype/toStringTag/toString-changed-tag.js @@ -0,0 +1,28 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.pluralrules.prototype-tostringtag +description: > + Object.prototype.toString utilizes Intl.PluralRules.prototype[@@toStringTag]. +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.PluralRules.prototype [ @@toStringTag ] + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.toStringTag] +---*/ + +Object.defineProperty(Intl.PluralRules.prototype, Symbol.toStringTag, { + value: "test262", +}); + +assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object test262]"); +assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object test262]"); diff --git a/test/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js b/test/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js new file mode 100644 index 0000000000..11c2bddaf8 --- /dev/null +++ b/test/intl402/PluralRules/prototype/toStringTag/toString-removed-tag.js @@ -0,0 +1,22 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.pluralrules.prototype-tostringtag +description: > + Object.prototype.toString doesn't special-case neither Intl.PluralRules instances nor its prototype. +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 "]". +features: [Symbol.toStringTag] +---*/ + +delete Intl.PluralRules.prototype[Symbol.toStringTag]; + +assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Object]"); +assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object Object]"); diff --git a/test/intl402/PluralRules/prototype/toStringTag/toString.js b/test/intl402/PluralRules/prototype/toStringTag/toString.js new file mode 100644 index 0000000000..0be630432e --- /dev/null +++ b/test/intl402/PluralRules/prototype/toStringTag/toString.js @@ -0,0 +1,24 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-intl.pluralrules.prototype-tostringtag +description: > + Object.prototype.toString utilizes Intl.PluralRules.prototype[@@toStringTag]. +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.PluralRules.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the String value "Intl.PluralRules". +features: [Symbol.toStringTag] +---*/ + +assert.sameValue(Object.prototype.toString.call(Intl.PluralRules.prototype), "[object Intl.PluralRules]"); +assert.sameValue(Object.prototype.toString.call(new Intl.PluralRules()), "[object Intl.PluralRules]"); diff --git a/test/intl402/PluralRules/prototype/toStringTag/toStringTag.js b/test/intl402/PluralRules/prototype/toStringTag/toStringTag.js new file mode 100644 index 0000000000..f7d3ba6aa7 --- /dev/null +++ b/test/intl402/PluralRules/prototype/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.pluralrules.prototype-tostringtag +description: > + Property descriptor of Intl.PluralRules.prototype[@@toStringTag]. +info: | + Intl.PluralRules.prototype [ @@toStringTag ] + + The initial value of the @@toStringTag property is the String value "Intl.PluralRules". + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.toStringTag] +includes: [propertyHelper.js] +---*/ + +verifyProperty(Intl.PluralRules.prototype, Symbol.toStringTag, { + value: "Intl.PluralRules", + writable: false, + enumerable: false, + configurable: true, +});