1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | var _index = require("./index.js");
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | class SymbolValue extends _index.PrimitiveValue {
|
21 | constructor(realm, desc, intrinsicName) {
|
22 | super(realm, intrinsicName);
|
23 | this.$Description = desc;
|
24 | }
|
25 |
|
26 | equals(x) {
|
27 | return this === x;
|
28 | }
|
29 |
|
30 | getHash() {
|
31 | if (this.hashValue === undefined) {
|
32 | this.hashValue = ++this.$Realm.symbolCount;
|
33 | }
|
34 |
|
35 | return this.hashValue;
|
36 | }
|
37 |
|
38 | mightBeFalse() {
|
39 | return false;
|
40 | }
|
41 |
|
42 | throwIfNotConcreteSymbol() {
|
43 | return this;
|
44 | }
|
45 |
|
46 | _serialize() {
|
47 | return Symbol(this.$Description);
|
48 | }
|
49 |
|
50 | toDisplayString() {
|
51 | if (this.$Description) {
|
52 | if (this.$Description instanceof _index.PrimitiveValue) {
|
53 | return `Symbol(${this.$Description.toDisplayString()})`;
|
54 | }
|
55 | }
|
56 |
|
57 | return "Symbol(to be supported)";
|
58 | }
|
59 |
|
60 | }
|
61 |
|
62 | exports.default = SymbolValue;
|
63 |
|
\ | No newline at end of file |