prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
55 lines (46 loc) • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _index = require("./index.js");
class SymbolValue extends _index.PrimitiveValue {
constructor(realm, desc, intrinsicName) {
super(realm, intrinsicName);
this.$Description = desc;
}
equals(x) {
return x instanceof SymbolValue && this.hashValue === x.hashValue && this.$Description === x.$Description;
}
getHash() {
if (!this.hashValue) {
this.hashValue = this.$Description ? this.$Description.getHash() : ++this.$Realm.symbolCount;
}
return this.hashValue;
}
mightBeFalse() {
return false;
}
throwIfNotConcreteSymbol() {
return this;
}
_serialize() {
return Symbol(this.$Description);
}
toDisplayString() {
if (this.$Description) {
if (this.$Description instanceof _index.PrimitiveValue) {
return `Symbol(${this.$Description.toDisplayString()})`;
}
}
return "Symbol(to be supported)";
}
}
exports.default = SymbolValue; /**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
//# sourceMappingURL=SymbolValue.js.map