Skip to content
Snippets Groups Projects
Commit d88d1fb2 authored by Daniel Ehrenberg's avatar Daniel Ehrenberg
Browse files

BigInt: Add test for BigInt.prototype[Symbol.toStringTag]

parent a456b0a3
No related branches found
No related tags found
No related merge requests found
// Copyright (C) 2017 Igalia, S. L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-bigint-@@tostringtag
description: >
`Symbol.toStringTag` property descriptor
info: >
The initial value of the @@toStringTag property is the String value
"BigInt".
This property has the attributes { [[Writable]]: false, [[Enumerable]]:
false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Symbol.toStringTag, BigInt, Symbol]
---*/
verifyProperty(BigInt.prototype, Symbol.toStringTag, {
value: "BigInt",
writable: false,
enumerable: false,
configurable: true
});
assertEquals("[object BigInt]", Object.prototype.toString.call(3n));
assertEquals("[object BigInt]", Object.prototype.toString.call(Object(3n)));
// Verify that Object.prototype.toString does not have special casing for BigInt
// as it does for most other primitive types
Object.defineProperty(BigInt.prototype, {
value: "FooBar",
writable: false,
enumerable: false,
configurable: true
});
assertEquals("[object FooBar]", Object.prototype.toString.call(3n));
assertEquals("[object FooBar]", Object.prototype.toString.call(Object(3n)));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment