greybel-interpreter 1.4.4 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/context.d.ts +3 -2
  2. package/dist/context.js +113 -190
  3. package/dist/cps.js +135 -188
  4. package/dist/handler/error.js +6 -29
  5. package/dist/handler/output.js +15 -38
  6. package/dist/handler/resource.js +16 -39
  7. package/dist/handler-container.js +6 -8
  8. package/dist/index.d.ts +4 -3
  9. package/dist/index.js +10 -9
  10. package/dist/interpreter.d.ts +5 -4
  11. package/dist/interpreter.js +109 -203
  12. package/dist/operations/assign.d.ts +1 -1
  13. package/dist/operations/assign.js +28 -93
  14. package/dist/operations/block.d.ts +1 -1
  15. package/dist/operations/block.js +33 -89
  16. package/dist/operations/break.d.ts +1 -1
  17. package/dist/operations/break.js +11 -29
  18. package/dist/operations/call.d.ts +1 -1
  19. package/dist/operations/call.js +31 -106
  20. package/dist/operations/chunk.d.ts +1 -1
  21. package/dist/operations/chunk.js +15 -67
  22. package/dist/operations/continue.d.ts +1 -1
  23. package/dist/operations/continue.js +11 -29
  24. package/dist/operations/debugger-statement.d.ts +1 -1
  25. package/dist/operations/debugger-statement.js +11 -29
  26. package/dist/operations/evaluate.d.ts +1 -1
  27. package/dist/operations/evaluate.js +143 -247
  28. package/dist/operations/for.d.ts +1 -1
  29. package/dist/operations/for.js +62 -133
  30. package/dist/operations/function-reference.d.ts +1 -1
  31. package/dist/operations/function-reference.js +25 -84
  32. package/dist/operations/function.d.ts +1 -1
  33. package/dist/operations/function.js +49 -177
  34. package/dist/operations/if-statement.d.ts +1 -1
  35. package/dist/operations/if-statement.js +58 -154
  36. package/dist/operations/import.d.ts +1 -1
  37. package/dist/operations/import.js +35 -97
  38. package/dist/operations/include.d.ts +1 -1
  39. package/dist/operations/include.js +19 -73
  40. package/dist/operations/list.d.ts +1 -1
  41. package/dist/operations/list.js +24 -93
  42. package/dist/operations/literal.d.ts +1 -1
  43. package/dist/operations/literal.js +15 -33
  44. package/dist/operations/map.d.ts +1 -1
  45. package/dist/operations/map.js +26 -153
  46. package/dist/operations/negated-binary.d.ts +1 -1
  47. package/dist/operations/negated-binary.js +24 -91
  48. package/dist/operations/new-instance.d.ts +1 -1
  49. package/dist/operations/new-instance.js +21 -82
  50. package/dist/operations/noop.d.ts +1 -1
  51. package/dist/operations/noop.js +10 -27
  52. package/dist/operations/not.d.ts +1 -1
  53. package/dist/operations/not.js +17 -78
  54. package/dist/operations/operation.d.ts +2 -2
  55. package/dist/operations/operation.js +3 -5
  56. package/dist/operations/reference.d.ts +1 -1
  57. package/dist/operations/reference.js +10 -28
  58. package/dist/operations/resolve.d.ts +1 -1
  59. package/dist/operations/resolve.js +161 -281
  60. package/dist/operations/return.d.ts +1 -1
  61. package/dist/operations/return.js +27 -89
  62. package/dist/operations/while.d.ts +1 -1
  63. package/dist/operations/while.js +45 -116
  64. package/dist/types/base.d.ts +9 -0
  65. package/dist/types/base.js +5 -0
  66. package/dist/types/boolean.d.ts +3 -1
  67. package/dist/types/boolean.js +24 -36
  68. package/dist/types/default.d.ts +6 -9
  69. package/dist/types/default.js +11 -17
  70. package/dist/types/function.d.ts +1 -1
  71. package/dist/types/function.js +60 -130
  72. package/dist/types/interface.d.ts +2 -1
  73. package/dist/types/interface.js +44 -64
  74. package/dist/types/list.d.ts +4 -6
  75. package/dist/types/list.js +77 -128
  76. package/dist/types/map.d.ts +11 -15
  77. package/dist/types/map.js +101 -267
  78. package/dist/types/nil.d.ts +2 -1
  79. package/dist/types/nil.js +23 -36
  80. package/dist/types/number.d.ts +16 -2
  81. package/dist/types/number.js +60 -37
  82. package/dist/types/string.d.ts +4 -6
  83. package/dist/types/string.js +66 -90
  84. package/dist/types/{generics.d.ts → with-intrinsics.d.ts} +6 -9
  85. package/dist/types/with-intrinsics.js +19 -0
  86. package/dist/utils/deep-equal.js +9 -34
  87. package/dist/utils/object-value.d.ts +7 -0
  88. package/dist/utils/object-value.js +42 -0
  89. package/dist/utils/path.js +16 -43
  90. package/package.json +3 -3
  91. package/dist/intrinsics-container.d.ts +0 -7
  92. package/dist/intrinsics-container.js +0 -19
  93. package/dist/types/generics.js +0 -40
@@ -1,103 +1,83 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
18
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
19
4
  };
20
5
  Object.defineProperty(exports, "__esModule", { value: true });
21
6
  exports.CustomInterfaceIterator = void 0;
22
- var path_1 = __importDefault(require("../utils/path"));
23
- var default_1 = __importDefault(require("./default"));
24
- var generics_1 = require("./generics");
25
- var CustomInterfaceIterator = /** @class */ (function () {
26
- function CustomInterfaceIterator() {
27
- }
28
- CustomInterfaceIterator.prototype.next = function () {
7
+ const path_1 = __importDefault(require("../utils/path"));
8
+ const base_1 = __importDefault(require("./base"));
9
+ const default_1 = __importDefault(require("./default"));
10
+ const with_intrinsics_1 = require("./with-intrinsics");
11
+ class CustomInterfaceIterator {
12
+ next() {
29
13
  return {
30
14
  value: default_1.default.Void,
31
15
  done: true
32
16
  };
33
- };
34
- return CustomInterfaceIterator;
35
- }());
17
+ }
18
+ }
36
19
  exports.CustomInterfaceIterator = CustomInterfaceIterator;
37
- var CustomInterface = /** @class */ (function (_super) {
38
- __extends(CustomInterface, _super);
39
- function CustomInterface(type) {
40
- var _this = _super.call(this) || this;
41
- _this.value = {};
42
- _this.type = type;
43
- _this.interfaceFns = new Map();
44
- return _this;
20
+ class CustomInterface extends with_intrinsics_1.CustomObject {
21
+ constructor(type) {
22
+ super();
23
+ this.value = {};
24
+ this.type = type;
25
+ this.interfaceFns = new Map();
45
26
  }
46
- CustomInterface.prototype.getCustomType = function () {
27
+ getCustomType() {
47
28
  return this.type;
48
- };
49
- CustomInterface.prototype.toString = function () {
29
+ }
30
+ toString() {
50
31
  return this.type;
51
- };
52
- CustomInterface.prototype.fork = function () {
32
+ }
33
+ fork() {
53
34
  return this;
54
- };
55
- CustomInterface.prototype.toNumber = function () {
35
+ }
36
+ toNumber() {
56
37
  return Number.NaN;
57
- };
58
- CustomInterface.prototype.toInt = function () {
38
+ }
39
+ toInt() {
59
40
  return 0;
60
- };
61
- CustomInterface.prototype.toTruthy = function () {
41
+ }
42
+ toTruthy() {
62
43
  return true;
63
- };
64
- CustomInterface.prototype[Symbol.iterator] = function () {
44
+ }
45
+ [Symbol.iterator]() {
65
46
  return new CustomInterfaceIterator();
66
- };
67
- CustomInterface.prototype.has = function (path) {
68
- if (path instanceof generics_1.CustomValue) {
47
+ }
48
+ has(path) {
49
+ if (path instanceof base_1.default) {
69
50
  return this.has(new path_1.default([path]));
70
51
  }
71
- var traversalPath = path.clone();
72
- var current = traversalPath.next();
52
+ const traversalPath = path.clone();
53
+ const current = traversalPath.next();
73
54
  if (current !== null) {
74
55
  return this.interfaceFns.has(current.toString());
75
56
  }
76
57
  return false;
77
- };
78
- CustomInterface.prototype.set = function (_path, _newValue) {
58
+ }
59
+ set(_path, _newValue) {
79
60
  throw new Error('Cannot set property on an interface.');
80
- };
81
- CustomInterface.prototype.get = function (path) {
82
- if (path instanceof generics_1.CustomValue) {
61
+ }
62
+ get(path) {
63
+ if (path instanceof base_1.default) {
83
64
  return this.get(new path_1.default([path]));
84
65
  }
85
66
  if (path.count() === 0) {
86
67
  return this;
87
68
  }
88
- var traversalPath = path.clone();
89
- var current = traversalPath.next();
69
+ const traversalPath = path.clone();
70
+ const current = traversalPath.next();
90
71
  if (current !== null) {
91
72
  if (this.interfaceFns.has(current.toString())) {
92
73
  return this.interfaceFns.get(current.toString());
93
74
  }
94
75
  }
95
- throw new Error("Unknown path in interface ".concat(path.toString(), "."));
96
- };
97
- CustomInterface.prototype.addFunction = function (name, fn) {
76
+ throw new Error(`Unknown path in interface ${path.toString()}.`);
77
+ }
78
+ addFunction(name, fn) {
98
79
  this.interfaceFns.set(name, fn);
99
80
  return this;
100
- };
101
- return CustomInterface;
102
- }(generics_1.CustomObject));
81
+ }
82
+ }
103
83
  exports.default = CustomInterface;
@@ -1,7 +1,7 @@
1
- import IntrinsicsContainer from '../intrinsics-container';
1
+ import ObjectValue from '../utils/object-value';
2
2
  import Path from '../utils/path';
3
- import CustomFunction from './function';
4
- import { CustomObject, CustomValue } from './generics';
3
+ import CustomValue from './base';
4
+ import { CustomObject } from './with-intrinsics';
5
5
  export declare class CustomListIterator implements Iterator<CustomValue> {
6
6
  value: Array<CustomValue>;
7
7
  index: number;
@@ -9,10 +9,8 @@ export declare class CustomListIterator implements Iterator<CustomValue> {
9
9
  next(): IteratorResult<CustomValue>;
10
10
  }
11
11
  export default class CustomList extends CustomObject {
12
+ static readonly intrinsics: ObjectValue;
12
13
  static getItemIndex(item: CustomList, index: number): number;
13
- private static intrinsics;
14
- static getIntrinsics(): IntrinsicsContainer;
15
- static addIntrinsic(name: string, fn: CustomFunction): void;
16
14
  readonly value: Array<CustomValue>;
17
15
  constructor(value?: Array<CustomValue>);
18
16
  getCustomType(): string;
@@ -1,61 +1,22 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __read = (this && this.__read) || function (o, n) {
18
- var m = typeof Symbol === "function" && o[Symbol.iterator];
19
- if (!m) return o;
20
- var i = m.call(o), r, ar = [], e;
21
- try {
22
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
23
- }
24
- catch (error) { e = { error: error }; }
25
- finally {
26
- try {
27
- if (r && !r.done && (m = i["return"])) m.call(i);
28
- }
29
- finally { if (e) throw e.error; }
30
- }
31
- return ar;
32
- };
33
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
34
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
35
- if (ar || !(i in from)) {
36
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
37
- ar[i] = from[i];
38
- }
39
- }
40
- return to.concat(ar || Array.prototype.slice.call(from));
41
- };
42
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
43
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
44
4
  };
45
5
  Object.defineProperty(exports, "__esModule", { value: true });
46
6
  exports.CustomListIterator = void 0;
47
- var intrinsics_container_1 = __importDefault(require("../intrinsics-container"));
48
- var path_1 = __importDefault(require("../utils/path"));
49
- var generics_1 = require("./generics");
50
- var number_1 = __importDefault(require("./number"));
51
- var CustomListIterator = /** @class */ (function () {
52
- function CustomListIterator(value) {
53
- var me = this;
7
+ const object_value_1 = __importDefault(require("../utils/object-value"));
8
+ const path_1 = __importDefault(require("../utils/path"));
9
+ const base_1 = __importDefault(require("./base"));
10
+ const number_1 = __importDefault(require("./number"));
11
+ const with_intrinsics_1 = require("./with-intrinsics");
12
+ class CustomListIterator {
13
+ constructor(value) {
14
+ const me = this;
54
15
  me.value = value;
55
16
  me.index = 0;
56
17
  }
57
- CustomListIterator.prototype.next = function () {
58
- var me = this;
18
+ next() {
19
+ const me = this;
59
20
  if (me.index === me.value.length) {
60
21
  return {
61
22
  value: null,
@@ -66,128 +27,118 @@ var CustomListIterator = /** @class */ (function () {
66
27
  value: me.value[me.index++],
67
28
  done: false
68
29
  };
69
- };
70
- return CustomListIterator;
71
- }());
30
+ }
31
+ }
72
32
  exports.CustomListIterator = CustomListIterator;
73
- var CustomList = /** @class */ (function (_super) {
74
- __extends(CustomList, _super);
75
- function CustomList(value) {
76
- if (value === void 0) { value = []; }
77
- var _this = _super.call(this) || this;
78
- _this.value = __spreadArray([], __read(value), false);
79
- return _this;
80
- }
81
- CustomList.getItemIndex = function (item, index) {
82
- var n = index | 0;
33
+ class CustomList extends with_intrinsics_1.CustomObject {
34
+ constructor(value = []) {
35
+ super();
36
+ this.value = [...value];
37
+ }
38
+ static getItemIndex(item, index) {
39
+ let n = index | 0;
83
40
  if (n < 0)
84
41
  n += item.value.length;
85
42
  if (n < 0 || n >= item.value.length)
86
43
  return -1;
87
44
  return n;
88
- };
89
- CustomList.getIntrinsics = function () {
90
- return this.intrinsics;
91
- };
92
- CustomList.addIntrinsic = function (name, fn) {
93
- this.intrinsics.add(name, fn);
94
- };
95
- CustomList.prototype.getCustomType = function () {
45
+ }
46
+ getCustomType() {
96
47
  return 'list';
97
- };
98
- CustomList.prototype.toString = function () {
99
- return "[ ".concat(this.value.join(', '), " ]");
100
- };
101
- CustomList.prototype.fork = function () {
48
+ }
49
+ toString() {
50
+ return `[ ${this.value.join(', ')} ]`;
51
+ }
52
+ fork() {
102
53
  return new CustomList(this.value);
103
- };
104
- CustomList.prototype.toNumber = function () {
54
+ }
55
+ toNumber() {
105
56
  return 0;
106
- };
107
- CustomList.prototype.toInt = function () {
57
+ }
58
+ toInt() {
108
59
  return 0;
109
- };
110
- CustomList.prototype.toTruthy = function () {
60
+ }
61
+ toTruthy() {
111
62
  return this.value.length > 0;
112
- };
113
- CustomList.prototype.slice = function (a, b) {
63
+ }
64
+ slice(a, b) {
114
65
  return new CustomList(this.value.slice(a.toNumber(), b.toNumber()));
115
- };
116
- CustomList.prototype.extend = function (list) {
66
+ }
67
+ extend(list) {
117
68
  if (list instanceof CustomList) {
118
69
  list = list.value;
119
70
  }
120
- for (var index = 0; index < list.length; index++) {
71
+ for (let index = 0; index < list.length; index++) {
121
72
  this.value.push(list[index]);
122
73
  }
123
74
  return this;
124
- };
125
- CustomList.prototype[Symbol.iterator] = function () {
75
+ }
76
+ [Symbol.iterator]() {
126
77
  return new CustomListIterator(this.value);
127
- };
128
- CustomList.prototype.getItemIndex = function (index) {
78
+ }
79
+ getItemIndex(index) {
129
80
  return CustomList.getItemIndex(this, index);
130
- };
131
- CustomList.prototype.has = function (path) {
132
- if (path instanceof generics_1.CustomValue) {
81
+ }
82
+ has(path) {
83
+ if (path instanceof base_1.default) {
133
84
  return this.has(new path_1.default([path]));
134
85
  }
135
- var traversalPath = path.clone();
136
- var current = traversalPath.next();
86
+ const traversalPath = path.clone();
87
+ const current = traversalPath.next();
137
88
  if (current instanceof number_1.default) {
138
- var currentIndex = this.getItemIndex(current.toInt());
139
- var sub = this.value[currentIndex];
89
+ const currentIndex = this.getItemIndex(current.toInt());
90
+ const sub = this.value[currentIndex];
140
91
  if (sub) {
141
92
  if (traversalPath.count() > 0 &&
142
- sub instanceof generics_1.CustomValueWithIntrinsics) {
93
+ sub instanceof with_intrinsics_1.CustomValueWithIntrinsics) {
143
94
  return sub.has(traversalPath);
144
95
  }
145
96
  return traversalPath.count() === 0;
146
97
  }
147
98
  }
148
99
  return false;
149
- };
150
- CustomList.prototype.set = function (path, newValue) {
151
- if (path instanceof generics_1.CustomValue) {
100
+ }
101
+ set(path, newValue) {
102
+ if (path instanceof base_1.default) {
152
103
  return this.set(new path_1.default([path]), newValue);
153
104
  }
154
- var traversalPath = path.clone();
155
- var last = traversalPath.last();
156
- var current = traversalPath.next();
105
+ const traversalPath = path.clone();
106
+ const last = traversalPath.last();
107
+ const current = traversalPath.next();
157
108
  if (current instanceof number_1.default) {
158
- var currentIndex = this.getItemIndex(current.toInt());
159
- var sub = this.value[currentIndex];
109
+ const currentIndex = this.getItemIndex(current.toInt());
110
+ const sub = this.value[currentIndex];
160
111
  if (sub) {
161
112
  if (traversalPath.count() > 0 &&
162
- sub instanceof generics_1.CustomValueWithIntrinsics) {
113
+ sub instanceof with_intrinsics_1.CustomValueWithIntrinsics) {
163
114
  sub.set(traversalPath, newValue);
164
115
  return;
165
116
  }
166
117
  }
167
- throw new Error("Cannot set path ".concat(path.toString(), "."));
118
+ throw new Error(`Cannot set path ${path.toString()}.`);
168
119
  }
169
120
  if (last instanceof number_1.default) {
170
- var lastIndex = this.getItemIndex(last.toInt());
121
+ const lastIndex = this.getItemIndex(last.toInt());
171
122
  if (lastIndex >= 0 && lastIndex < this.value.length) {
172
123
  this.value[lastIndex] = newValue;
173
124
  return;
174
125
  }
175
- throw new Error("Index error (list index ".concat(lastIndex, " out of range)."));
126
+ throw new Error(`Index error (list index ${lastIndex} out of range).`);
176
127
  }
177
- throw new Error("Index is not a number.");
178
- };
179
- CustomList.prototype.get = function (path) {
180
- if (path instanceof generics_1.CustomValue) {
128
+ throw new Error(`Index is not a number.`);
129
+ }
130
+ get(path) {
131
+ if (path instanceof base_1.default) {
181
132
  return this.get(new path_1.default([path]));
182
133
  }
183
- var traversalPath = path.clone();
184
- var current = traversalPath.next();
134
+ const traversalPath = path.clone();
135
+ const current = traversalPath.next();
185
136
  if (current instanceof number_1.default) {
186
- var currentIndex = this.getItemIndex(current.toInt());
137
+ const currentIndex = this.getItemIndex(current.toInt());
187
138
  if (currentIndex >= 0 && currentIndex < this.value.length) {
188
- var sub = this.value[currentIndex];
139
+ const sub = this.value[currentIndex];
189
140
  if (traversalPath.count() > 0) {
190
- if (sub instanceof generics_1.CustomValueWithIntrinsics) {
141
+ if (sub instanceof with_intrinsics_1.CustomValueWithIntrinsics) {
191
142
  return sub.get(traversalPath);
192
143
  }
193
144
  }
@@ -195,15 +146,13 @@ var CustomList = /** @class */ (function (_super) {
195
146
  return sub;
196
147
  }
197
148
  }
198
- throw new Error("Index error (list index ".concat(currentIndex, " out of range)."));
149
+ throw new Error(`Index error (list index ${currentIndex} out of range).`);
199
150
  }
200
- else if (path.count() === 1 &&
201
- CustomList.getIntrinsics().has(current.toString())) {
202
- return CustomList.getIntrinsics().get(current.toString());
151
+ else if (path.count() === 1 && CustomList.getIntrinsics().has(current)) {
152
+ return CustomList.getIntrinsics().get(current);
203
153
  }
204
- throw new Error("Unknown path in list ".concat(path.toString(), "."));
205
- };
206
- CustomList.intrinsics = new intrinsics_container_1.default();
207
- return CustomList;
208
- }(generics_1.CustomObject));
154
+ throw new Error(`Unknown path in list ${path.toString()}.`);
155
+ }
156
+ }
209
157
  exports.default = CustomList;
158
+ CustomList.intrinsics = new object_value_1.default();
@@ -1,27 +1,23 @@
1
- import IntrinsicsContainer from '../intrinsics-container';
1
+ import ObjectValue from '../utils/object-value';
2
2
  import Path from '../utils/path';
3
- import CustomFunction from './function';
4
- import { CustomObject, CustomValue } from './generics';
3
+ import CustomValue from './base';
5
4
  import CustomString from './string';
5
+ import { CustomObject } from './with-intrinsics';
6
6
  export declare const CLASS_ID_PROPERTY: CustomString;
7
7
  export declare const ISA_PROPERTY: CustomString;
8
- export declare const getValue: (map: Map<CustomValue, CustomValue>, mapKey: CustomValue) => CustomValue;
9
- export declare const hasValue: (map: Map<CustomValue, CustomValue>, mapKey: CustomValue) => boolean;
10
- export declare const setValue: (map: Map<CustomValue, CustomValue>, mapKey: CustomValue, mapValue: CustomValue) => void;
11
8
  export declare class CustomMapIterator implements Iterator<CustomValue> {
12
- value: Map<CustomValue, CustomValue>;
9
+ value: ObjectValue;
13
10
  index: number;
14
- constructor(value: Map<CustomValue, CustomValue>);
11
+ constructor(value: ObjectValue);
15
12
  next(): IteratorResult<CustomMap>;
16
13
  }
17
14
  export default class CustomMap extends CustomObject {
18
- private static intrinsics;
19
- static getIntrinsics(): IntrinsicsContainer;
20
- static addIntrinsic(name: string, fn: CustomFunction): void;
21
- readonly value: Map<CustomValue, CustomValue>;
22
- readonly isa: Map<CustomValue, CustomValue>;
15
+ static readonly intrinsics: ObjectValue;
16
+ value: ObjectValue;
17
+ readonly isa: ObjectValue;
23
18
  private isInstance;
24
- constructor(value?: Map<CustomValue, CustomValue>, isa?: Map<CustomValue, CustomValue>);
19
+ static createWithInitialValue(value: ObjectValue): CustomMap;
20
+ constructor(value?: ObjectValue, isa?: ObjectValue);
25
21
  getCustomType(): string;
26
22
  toString(): string;
27
23
  fork(): CustomMap;
@@ -29,7 +25,7 @@ export default class CustomMap extends CustomObject {
29
25
  toInt(): number;
30
26
  toTruthy(): boolean;
31
27
  [Symbol.iterator](): CustomMapIterator;
32
- extend(map: CustomMap | Map<CustomValue, CustomValue>): CustomMap;
28
+ extend(map: CustomMap | ObjectValue): CustomMap;
33
29
  has(path: Path<CustomValue> | CustomValue): boolean;
34
30
  set(path: Path<CustomValue> | CustomValue, newValue: CustomValue): void;
35
31
  get(path: Path<CustomValue> | CustomValue): CustomValue;