prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
63 lines (49 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _index = require("./index.js");
/**
* 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.
*/
/* strict-local */
class SymbolValue extends _index.PrimitiveValue {
constructor(realm, desc, intrinsicName) {
super(realm, intrinsicName);
this.$Description = desc;
}
equals(x) {
return this === x;
}
getHash() {
if (this.hashValue === undefined) {
this.hashValue = ++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;
//# sourceMappingURL=SymbolValue.js.map