diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-regexp.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-regexp.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-regexp.js b/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-regexp.js new file mode 100644 index 0000000000..8e9f77955d --- /dev/null +++ b/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-regexp.js @@ -0,0 +1,29 @@ +// 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: has a [[RegExpMatcher]] internal slot, let builtinTag be "RegExp". +---*/ +assert.sameValue( + Object.prototype.toString.call(/./), + "[object RegExp]", + "Object.prototype.toString.call(/./) returns [object RegExp]" +); +assert.sameValue( + Object.prototype.toString.call(Object(/./)), + "[object RegExp]", + "Object.prototype.toString.call(Object(/./)) returns [object RegExp]" +); +assert.sameValue( + Object.prototype.toString.call(new RegExp()), + "[object RegExp]", + "Object.prototype.toString.call(new RegExp()) returns [object RegExp]" +); +assert.sameValue( + Object.prototype.toString.call(Object(new RegExp())), + "[object RegExp]", + "Object.prototype.toString.call(Object(new RegExp())) returns [object RegExp]" +); + +reportCompare(0, 0); |