diff options
Diffstat (limited to 'js/src/tests/test262/intl402/Collator/prototype/toStringTag/toString-changed-tag.js')
-rw-r--r-- | js/src/tests/test262/intl402/Collator/prototype/toStringTag/toString-changed-tag.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Collator/prototype/toStringTag/toString-changed-tag.js b/js/src/tests/test262/intl402/Collator/prototype/toStringTag/toString-changed-tag.js new file mode 100644 index 0000000000..84dcbda908 --- /dev/null +++ b/js/src/tests/test262/intl402/Collator/prototype/toStringTag/toString-changed-tag.js @@ -0,0 +1,30 @@ +// 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]"); + +reportCompare(0, 0); |