summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/toString/Object.prototype.toString.call-error.js
blob: 044d4349c7d28fb62f30ee85498bd242a3f41060 (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
28
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 an [[ErrorData]] internal slot, let builtinTag be "Error".
---*/
assert.sameValue(
  Object.prototype.toString.call(Error()),
  "[object Error]",
  "Object.prototype.toString.call(Error()) returns [object Error]"
);
assert.sameValue(
  Object.prototype.toString.call(Object(Error())),
  "[object Error]",
  "Object.prototype.toString.call(Object(Error())) returns [object Error]"
);
assert.sameValue(
  Object.prototype.toString.call(new Error()),
  "[object Error]",
  "Object.prototype.toString.call(new Error()) returns [object Error]"
);
assert.sameValue(
  Object.prototype.toString.call(Object(new Error())),
  "[object Error]",
  "Object.prototype.toString.call(Object(new Error())) returns [object Error]"
);

reportCompare(0, 0);