mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Test that Error.prototype has no [[ErrorData]] slot
This commit is contained in:
parent
accf91c57d
commit
9aef4bd5eb
34
test/built-ins/Error/prototype/no-error-data.js
vendored
Normal file
34
test/built-ins/Error/prototype/no-error-data.js
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-properties-of-the-error-prototype-object
|
||||||
|
description: >
|
||||||
|
The Error Prototype object does not have a [[ErrorData]] internal slot.
|
||||||
|
info: |
|
||||||
|
Properties of the Error Prototype Object
|
||||||
|
|
||||||
|
The Error prototype object:
|
||||||
|
[...]
|
||||||
|
* is not an Error instance and does not have an [[ErrorData]] internal slot.
|
||||||
|
|
||||||
|
Object.prototype.toString ( )
|
||||||
|
|
||||||
|
[...]
|
||||||
|
8. Else if O has an [[ErrorData]] internal slot, let builtinTag be "Error".
|
||||||
|
[...]
|
||||||
|
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 "]".
|
||||||
|
features: [Symbol.toStringTag]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// Although the spec doesn't define Error.prototype[@@toStringTag], set it
|
||||||
|
// to non-string anyway because implementations are allowed to define it.
|
||||||
|
Object.defineProperty(Error.prototype, Symbol.toStringTag, {
|
||||||
|
value: null,
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
Object.prototype.toString.call(Error.prototype),
|
||||||
|
"[object Object]"
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user