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