diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-string.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-string.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-string.js b/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-string.js new file mode 100644 index 0000000000..61c9853ae0 --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-string.js @@ -0,0 +1,39 @@ +// Copyright 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-object.prototype.tostring +description: is a String exotic object, let builtinTag be "String". +---*/ +assert.sameValue( + Object.prototype.toString.call(""), + "[object String]", + "Object.prototype.toString.call(\"\") returns [object String]" +); +assert.sameValue( + Object.prototype.toString.call(Object("")), + "[object String]", + "Object.prototype.toString.call(Object(\"\")) returns [object String]" +); +assert.sameValue( + Object.prototype.toString.call(String("")), + "[object String]", + "Object.prototype.toString.call(String(\"\")) returns [object String]" +); +assert.sameValue( + Object.prototype.toString.call(Object(String(""))), + "[object String]", + "Object.prototype.toString.call(Object(String(\"\"))) returns [object String]" +); +assert.sameValue( + Object.prototype.toString.call(new String("")), + "[object String]", + "Object.prototype.toString.call(new String(\"\")) returns [object String]" +); +assert.sameValue( + Object.prototype.toString.call(Object(new String(""))), + "[object String]", + "Object.prototype.toString.call(Object(new String(\"\"))) returns [object String]" +); + +reportCompare(0, 0); |