UNPKG

1.29 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _index = require("./index.js");
9
10/**
11 * Copyright (c) 2017-present, Facebook, Inc.
12 * All rights reserved.
13 *
14 * This source code is licensed under the BSD-style license found in the
15 * LICENSE file in the root directory of this source tree. An additional grant
16 * of patent rights can be found in the PATENTS file in the same directory.
17 */
18
19/* strict-local */
20class 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
62exports.default = SymbolValue;
63//# sourceMappingURL=SymbolValue.js.map
\No newline at end of file