summaryrefslogtreecommitdiff
path: root/test/built-ins/Object/prototype/toString/Object.prototype.toString.call-regexp.js
blob: 520d3aeaf36b17d6e61afc13aaac09683aa9842d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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]"
);