1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | var _index = require("./index.js");
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | class BooleanValue extends _index.PrimitiveValue {
|
21 | constructor(realm, value, intrinsicName) {
|
22 | super(realm, intrinsicName);
|
23 | this.value = value;
|
24 | if (value && realm.intrinsics.true) return realm.intrinsics.true;
|
25 | if (!value && realm.intrinsics.false) return realm.intrinsics.false;
|
26 | }
|
27 |
|
28 | equals(x) {
|
29 | return x instanceof BooleanValue && this.value === x.value;
|
30 | }
|
31 |
|
32 | getHash() {
|
33 | return this.value ? 12484058682847432 : 3777063795205331;
|
34 | }
|
35 |
|
36 | mightBeFalse() {
|
37 | return !this.value;
|
38 | }
|
39 |
|
40 | throwIfNotConcreteBoolean() {
|
41 | return this;
|
42 | }
|
43 |
|
44 | _serialize() {
|
45 | return this.value;
|
46 | }
|
47 |
|
48 | toDisplayString() {
|
49 | return this.value.toString();
|
50 | }
|
51 |
|
52 | }
|
53 |
|
54 | exports.default = BooleanValue;
|
55 |
|
\ | No newline at end of file |