prepack
Version:
Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.
51 lines (40 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _index = require("../methods/index.js");
var _index2 = require("../values/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.
*/
class StringValue extends _index2.PrimitiveValue {
constructor(realm, value, intrinsicName) {
super(realm, intrinsicName);
this.value = value;
}
equals(x) {
return x instanceof StringValue && this.value === x.value;
}
getHash() {
return (0, _index.hashString)(this.value);
}
mightBeFalse() {
return this.value.length === 0;
}
throwIfNotConcreteString() {
return this;
}
_serialize() {
return this.value;
}
toDisplayString() {
return `"${this.value}"`;
}
}
exports.default = StringValue;
//# sourceMappingURL=StringValue.js.map