UNPKG

prepack

Version:

Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.

50 lines (40 loc) 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _index = require("./index.js"); class BooleanValue extends _index.PrimitiveValue { constructor(realm, value, intrinsicName) { super(realm, intrinsicName); this.value = value; if (value && realm.intrinsics.true) return realm.intrinsics.true; if (!value && realm.intrinsics.false) return realm.intrinsics.false; } equals(x) { return x instanceof BooleanValue && this.value === x.value; } getHash() { return this.value ? 12484058682847432 : 3777063795205331; } mightBeFalse() { return !this.value; } throwIfNotConcreteBoolean() { return this; } _serialize() { return this.value; } toDisplayString() { return this.value.toString(); } } exports.default = BooleanValue; /** * 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=BooleanValue.js.map