@ibyar/expressions 1.0.0 → 1.1.0
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.
- package/README.md +48 -1
- package/api/class/class.js +143 -93
- package/api/class/class.js.map +1 -1
- package/api/class/decorator.js +8 -3
- package/api/class/decorator.js.map +1 -1
- package/api/computing/call.js +8 -3
- package/api/computing/call.js.map +1 -1
- package/api/computing/debugger.js +8 -3
- package/api/computing/debugger.js.map +1 -1
- package/api/computing/new.js +8 -3
- package/api/computing/new.js.map +1 -1
- package/api/computing/rest.js +8 -3
- package/api/computing/rest.js.map +1 -1
- package/api/computing/return.js +8 -3
- package/api/computing/return.js.map +1 -1
- package/api/computing/spread.js +8 -3
- package/api/computing/spread.js.map +1 -1
- package/api/computing/throw.js +38 -23
- package/api/computing/throw.js.map +1 -1
- package/api/computing/yield.js +8 -3
- package/api/computing/yield.js.map +1 -1
- package/api/definition/array.js +23 -13
- package/api/definition/array.js.map +1 -1
- package/api/definition/bind.js +8 -3
- package/api/definition/bind.js.map +1 -1
- package/api/definition/comment.js +8 -3
- package/api/definition/comment.js.map +1 -1
- package/api/definition/function.js +53 -33
- package/api/definition/function.js.map +1 -1
- package/api/definition/member.js +8 -3
- package/api/definition/member.js.map +1 -1
- package/api/definition/object.js +38 -23
- package/api/definition/object.js.map +1 -1
- package/api/definition/statement.js +8 -3
- package/api/definition/statement.js.map +1 -1
- package/api/definition/values.js +68 -43
- package/api/definition/values.js.map +1 -1
- package/api/module/common.js +8 -3
- package/api/module/common.js.map +1 -1
- package/api/module/export.js +53 -33
- package/api/module/export.js.map +1 -1
- package/api/module/import.js +68 -43
- package/api/module/import.js.map +1 -1
- package/api/operators/assignment.js +6 -2
- package/api/operators/assignment.js.map +1 -1
- package/api/operators/await.js +8 -3
- package/api/operators/await.js.map +1 -1
- package/api/operators/binary.js +6 -2
- package/api/operators/binary.js.map +1 -1
- package/api/operators/chaining.js +8 -3
- package/api/operators/chaining.js.map +1 -1
- package/api/operators/comma.js +8 -3
- package/api/operators/comma.js.map +1 -1
- package/api/operators/grouping.js +8 -3
- package/api/operators/grouping.js.map +1 -1
- package/api/operators/logical.js +6 -2
- package/api/operators/logical.js.map +1 -1
- package/api/operators/pipeline.js +8 -3
- package/api/operators/pipeline.js.map +1 -1
- package/api/operators/ternary.js +8 -3
- package/api/operators/ternary.js.map +1 -1
- package/api/operators/unary.js +6 -2
- package/api/operators/unary.js.map +1 -1
- package/api/operators/update.js +6 -2
- package/api/operators/update.js.map +1 -1
- package/api/program.js +8 -3
- package/api/program.js.map +1 -1
- package/api/statement/control/block.js +8 -3
- package/api/statement/control/block.js.map +1 -1
- package/api/statement/control/empty.js +8 -3
- package/api/statement/control/empty.js.map +1 -1
- package/api/statement/control/if.js +8 -3
- package/api/statement/control/if.js.map +1 -1
- package/api/statement/control/switch.js +38 -23
- package/api/statement/control/switch.js.map +1 -1
- package/api/statement/control/terminate.js +38 -23
- package/api/statement/control/terminate.js.map +1 -1
- package/api/statement/control/with.js +8 -3
- package/api/statement/control/with.js.map +1 -1
- package/api/statement/declarations/declares.js +23 -13
- package/api/statement/declarations/declares.js.map +1 -1
- package/api/statement/iterations/for.js +53 -33
- package/api/statement/iterations/for.js.map +1 -1
- package/api/statement/iterations/while.js +23 -13
- package/api/statement/iterations/while.js.map +1 -1
- package/package.json +5 -5
- package/scope/builder.d.ts +27 -0
- package/scope/builder.d.ts.map +1 -0
- package/scope/builder.js +73 -0
- package/scope/builder.js.map +1 -0
- package/scope/stack.js +1 -1
- package/scope/stack.js.map +1 -1
- package/v8/enums.js +2 -4
- package/v8/enums.js.map +1 -1
- package/v8/stream.js +1 -2
- package/v8/stream.js.map +1 -1
- package/v8/token.js +1 -2
- package/v8/token.js.map +1 -1
- package/v8/nodes.d.ts +0 -0
- package/v8/nodes.js +0 -2
- package/v8/nodes.js.map +0 -1
package/api/definition/values.js
CHANGED
|
@@ -10,15 +10,19 @@ import { AbstractExpressionNode } from '../abstract.js';
|
|
|
10
10
|
* there is no way to convert identifiers to strings,
|
|
11
11
|
* but sometimes it is possible to parse strings into identifiers.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
let Identifier = (() => {
|
|
14
14
|
let _classDecorators = [Deserializer('Identifier')];
|
|
15
15
|
let _classDescriptor;
|
|
16
16
|
let _classExtraInitializers = [];
|
|
17
17
|
let _classThis;
|
|
18
|
-
|
|
18
|
+
let _classSuper = AbstractExpressionNode;
|
|
19
|
+
var Identifier = class extends _classSuper {
|
|
20
|
+
static { _classThis = this; }
|
|
19
21
|
static {
|
|
20
|
-
|
|
22
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
23
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
21
24
|
Identifier = _classThis = _classDescriptor.value;
|
|
25
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
22
26
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
23
27
|
}
|
|
24
28
|
name;
|
|
@@ -70,16 +74,21 @@ export let Identifier = (() => {
|
|
|
70
74
|
};
|
|
71
75
|
return Identifier = _classThis;
|
|
72
76
|
})();
|
|
73
|
-
export
|
|
74
|
-
|
|
75
|
-
let
|
|
76
|
-
let
|
|
77
|
-
let
|
|
78
|
-
|
|
77
|
+
export { Identifier };
|
|
78
|
+
let ThisExpression = (() => {
|
|
79
|
+
let _classDecorators = [Deserializer('ThisExpression')];
|
|
80
|
+
let _classDescriptor;
|
|
81
|
+
let _classExtraInitializers = [];
|
|
82
|
+
let _classThis;
|
|
83
|
+
let _classSuper = Identifier;
|
|
84
|
+
var ThisExpression = class extends _classSuper {
|
|
85
|
+
static { _classThis = this; }
|
|
79
86
|
static {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
88
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
89
|
+
ThisExpression = _classThis = _classDescriptor.value;
|
|
90
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
91
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
83
92
|
}
|
|
84
93
|
static fromJSON(node) {
|
|
85
94
|
return new ThisExpression(node.range, node.loc);
|
|
@@ -91,18 +100,23 @@ export let ThisExpression = (() => {
|
|
|
91
100
|
return {};
|
|
92
101
|
}
|
|
93
102
|
};
|
|
94
|
-
return ThisExpression =
|
|
103
|
+
return ThisExpression = _classThis;
|
|
95
104
|
})();
|
|
96
|
-
export
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
let
|
|
100
|
-
let
|
|
101
|
-
|
|
105
|
+
export { ThisExpression };
|
|
106
|
+
let Literal = (() => {
|
|
107
|
+
let _classDecorators = [Deserializer('Literal')];
|
|
108
|
+
let _classDescriptor;
|
|
109
|
+
let _classExtraInitializers = [];
|
|
110
|
+
let _classThis;
|
|
111
|
+
let _classSuper = AbstractExpressionNode;
|
|
112
|
+
var Literal = class extends _classSuper {
|
|
113
|
+
static { _classThis = this; }
|
|
102
114
|
static {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
116
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
117
|
+
Literal = _classThis = _classDescriptor.value;
|
|
118
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
119
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
106
120
|
}
|
|
107
121
|
value;
|
|
108
122
|
static fromJSON(node) {
|
|
@@ -177,8 +191,9 @@ export let Literal = (() => {
|
|
|
177
191
|
};
|
|
178
192
|
}
|
|
179
193
|
};
|
|
180
|
-
return Literal =
|
|
194
|
+
return Literal = _classThis;
|
|
181
195
|
})();
|
|
196
|
+
export { Literal };
|
|
182
197
|
class TemplateArray extends Array {
|
|
183
198
|
raw;
|
|
184
199
|
constructor(strings) {
|
|
@@ -244,16 +259,20 @@ export class TemplateLiteralExpressionNode extends AbstractExpressionNode {
|
|
|
244
259
|
};
|
|
245
260
|
}
|
|
246
261
|
}
|
|
247
|
-
|
|
248
|
-
let
|
|
249
|
-
let
|
|
250
|
-
let
|
|
251
|
-
let
|
|
252
|
-
|
|
262
|
+
let TemplateLiteral = (() => {
|
|
263
|
+
let _classDecorators = [Deserializer('TemplateLiteral')];
|
|
264
|
+
let _classDescriptor;
|
|
265
|
+
let _classExtraInitializers = [];
|
|
266
|
+
let _classThis;
|
|
267
|
+
let _classSuper = TemplateLiteralExpressionNode;
|
|
268
|
+
var TemplateLiteral = class extends _classSuper {
|
|
269
|
+
static { _classThis = this; }
|
|
253
270
|
static {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
271
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
272
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
273
|
+
TemplateLiteral = _classThis = _classDescriptor.value;
|
|
274
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
275
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
257
276
|
}
|
|
258
277
|
static fromJSON(node, deserializer) {
|
|
259
278
|
return new TemplateLiteral(node.quasis, node.expressions.map(deserializer), node.range, node.loc);
|
|
@@ -265,18 +284,23 @@ export let TemplateLiteral = (() => {
|
|
|
265
284
|
return undefined;
|
|
266
285
|
}
|
|
267
286
|
};
|
|
268
|
-
return TemplateLiteral =
|
|
287
|
+
return TemplateLiteral = _classThis;
|
|
269
288
|
})();
|
|
270
|
-
export
|
|
271
|
-
|
|
272
|
-
let
|
|
273
|
-
let
|
|
274
|
-
let
|
|
275
|
-
|
|
289
|
+
export { TemplateLiteral };
|
|
290
|
+
let TaggedTemplateExpression = (() => {
|
|
291
|
+
let _classDecorators = [Deserializer('TaggedTemplateExpression')];
|
|
292
|
+
let _classDescriptor;
|
|
293
|
+
let _classExtraInitializers = [];
|
|
294
|
+
let _classThis;
|
|
295
|
+
let _classSuper = TemplateLiteralExpressionNode;
|
|
296
|
+
var TaggedTemplateExpression = class extends _classSuper {
|
|
297
|
+
static { _classThis = this; }
|
|
276
298
|
static {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
299
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
300
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
301
|
+
TaggedTemplateExpression = _classThis = _classDescriptor.value;
|
|
302
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
303
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
280
304
|
}
|
|
281
305
|
static fromJSON(node, deserializer) {
|
|
282
306
|
return new TaggedTemplateExpression(deserializer(node.tag), node.quasis, node.expressions.map(deserializer), node.range, node.loc);
|
|
@@ -288,6 +312,7 @@ export let TaggedTemplateExpression = (() => {
|
|
|
288
312
|
return super.getTag();
|
|
289
313
|
}
|
|
290
314
|
};
|
|
291
|
-
return TaggedTemplateExpression =
|
|
315
|
+
return TaggedTemplateExpression = _classThis;
|
|
292
316
|
})();
|
|
317
|
+
export { TaggedTemplateExpression };
|
|
293
318
|
//# sourceMappingURL=values.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/expressions/api/definition/values.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;AAEH,MAAM,KAAO,UAAU;4BADtB,YAAY,CAAC,YAAY,CAAC;;;;QACd,UAAU,QAAC,SAAQ,sBAAsB;;YAAtD,4IA+CC;YA/CY,UAAU;YAAV,uDAAU;;QAIA,IAAI;QAH1B,MAAM,CAAC,QAAQ,CAAC,IAAgB;YAC/B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;QACD,YAAsB,IAAqB,EAAE,KAAwB,EAAE,GAAoB;YAC1F,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YADG,SAAI,GAAJ,IAAI,CAAiB;QAE3C,CAAC;QACD,OAAO;YACN,OAAO,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,KAAU;YAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,WAAiB;YAClC,IAAI,WAAW,EAAE;gBAChB,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YACD,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAGD,SAAS,C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C;;WAnBW,eAAe;;AAuB5B,MAAM,KAAO,wBAAwB;8BADpC,YAAY,CAAC,0BAA0B,CAAC;;;;QAC5B,wBAAwB,QAAC,SAAQ,6BAA6B;;YAA3E,kJAsBC;YAtBY,wBAAwB;YAAxB,2DAAwB;;QACpC,MAAM,CAAC,QAAQ,CAAC,IAA8B,EAAE,YAA8B;YAC7E,OAAO,IAAI,wBAAwB,CAClC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EACtB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAClC,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,GAAG,CACR,CAAC;QACH,CAAC;QAED,YACC,GAAmB,EACnB,MAAgB,EAChB,WAA6B,EAC7B,KAAwB,EACxB,GAAoB;YACpB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;QACQ,MAAM;YACd,OAAO,KAAK,CAAC,MAAM,EAAG,CAAC;QACxB,CAAC;;WArBW,wBAAwB","sourcesContent":["import type {\n\tDeclarationExpression, ExpressionNode, NodeDeserializer,\n\tCanFindScope, ExpressionEventPath, VisitNodeType, SourceLocation\n} from '../expression.js';\nimport type { Context, Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode } from '../abstract.js';\n\n/**\n * An identifier is a sequence of characters in the code that identifies a variable, function, or property.\n * In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9),\n * but may not start with a digit.\n * An identifier differs from a string in that a string is data,\n * while an identifier is part of the code. In JavaScript,\n * there is no way to convert identifiers to strings,\n * but sometimes it is possible to parse strings into identifiers.\n */\n@Deserializer('Identifier')\nexport class Identifier extends AbstractExpressionNode implements DeclarationExpression, CanFindScope {\n\tstatic fromJSON(node: Identifier): Identifier {\n\t\treturn new Identifier(node.name, node.range, node.loc);\n\t}\n\tconstructor(protected name: string | number, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetName() {\n\t\treturn this.name;\n\t}\n\tset(stack: Stack, value: any) {\n\t\treturn stack.set(this.name, value) ? value : void 0;\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tif (thisContext) {\n\t\t\treturn thisContext[this.name];\n\t\t}\n\t\treturn stack.get(this.name);\n\t}\n\tfindScope<T extends object>(stack: Stack): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope: Scope<any>): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope?: Scope<any>): Scope<T> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.name);\n\t\t}\n\t\tscope = stack.findScope(this.name);\n\t\treturn scope.getInnerScope(this.name);\n\t}\n\tdeclareVariable(stack: Stack, propertyValue: any): any {\n\t\treturn stack.declareVariable(this.name, propertyValue);\n\t}\n\tgetDeclarationName(): string {\n\t\treturn this.toString();\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [this];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tconst path: ExpressionEventPath[] = [{ computed: false, path: this.toString() }];\n\t\treturn computed ? [{ computed, path: this.toString(), computedPath: [path] }] : path;\n\t}\n\ttoString(): string {\n\t\treturn String(this.name);\n\t}\n\ttoJson(): object {\n\t\treturn { name: this.name };\n\t}\n}\n\n@Deserializer('ThisExpression')\nexport class ThisExpression extends Identifier {\n\tstatic fromJSON(node: ThisExpression): ThisExpression {\n\t\treturn new ThisExpression(node.range, node.loc);\n\t}\n\tconstructor(\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper('this', range, loc);\n\t}\n\ttoJson(): object {\n\t\treturn {};\n\t}\n}\n\n@Deserializer('Literal')\nexport class Literal<T> extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: Literal<any>):\n\t\tLiteral<string>\n\t\t| Literal<number>\n\t\t| Literal<boolean>\n\t\t| Literal<RegExp>\n\t\t| Literal<bigint>\n\t\t| Literal<null>\n\t\t| Literal<undefined> {\n\t\tif (node.bigint) {\n\t\t\treturn new Literal(BigInt(node.bigint), node.raw, undefined, node.bigint, node.range, node.loc);\n\t\t} else if (node.regex) {\n\t\t\treturn new Literal(RegExp(node.regex.pattern, node.regex.flags), node.raw, node.regex, undefined, node.range, node.loc);\n\t\t}\n\t\treturn new Literal(node.value, node.raw, undefined, undefined, node.range, node.loc);\n\t}\n\tdeclare type: 'Literal';\n\tregex?: { pattern: string, flags: string };\n\tbigint?: string;\n\traw?: string\n\tconstructor(\n\t\tpublic value: T,\n\t\traw?: string,\n\t\tregex?: { pattern: string, flags: string },\n\t\tbigint?: string,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t\traw && (this.raw = raw);\n\t\tregex && (this.regex = regex);\n\t\tbigint && (this.bigint = bigint);\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tgetRegex() {\n\t\treturn this.regex;\n\t}\n\tgetBigint() {\n\t\treturn this.bigint;\n\t}\n\tgeRaw() {\n\t\treturn this.raw;\n\t}\n\tset() {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(): T {\n\t\treturn this.value;\n\t}\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.value as any);\n\t\t}\n\t\tscope = stack.findScope(this.value as any);\n\t\treturn scope.getInnerScope(this.value as any);\n\t}\n\tdependency(computed: true): ExpressionNode[] {\n\t\treturn computed ? [this] : [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn computed ? [{ computed: false, path: this.toString() }] : [];\n\t}\n\ttoString(): string {\n\t\treturn this.raw ?? String(this.value);\n\t}\n\ttoJson(): object {\n\t\tif (this.bigint) {\n\t\t\treturn {\n\t\t\t\tbigint: this.bigint,\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t} else if (this.regex) {\n\t\t\treturn {\n\t\t\t\tregex: { pattern: this.regex?.pattern, flags: this.regex?.flags },\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalue: this.value,\n\t\t\traw: this.raw,\n\t\t};\n\t}\n}\n\nclass TemplateArray extends Array<string> implements TemplateStringsArray {\n\traw: readonly string[];\n\tconstructor(strings: string[]) {\n\t\tsuper(...strings);\n\t\tthis.raw = strings;\n\t}\n}\n\nexport class TemplateLiteralExpressionNode extends AbstractExpressionNode {\n\tstatic visit(node: TemplateLiteralExpressionNode, visitNode: VisitNodeType): void {\n\t\tnode.tag && visitNode(node.tag);\n\t\tnode.expressions.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprotected quasis: string[],\n\t\tprotected expressions: ExpressionNode[],\n\t\tprotected tag?: ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetTag() {\n\t\treturn this.tag;\n\t}\n\tgetExpressions() {\n\t\treturn this.expressions;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`TemplateLiteralExpressionNode#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst tagged: Function = this.tag?.get(stack) || String.raw;\n\t\tconst templateStringsArray = new TemplateArray(this.quasis);\n\t\ttemplateStringsArray.raw = templateStringsArray;\n\t\tconst values = this.expressions.map(expr => expr.get(stack));\n\t\treturn tagged(templateStringsArray, ...values);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tlet str = this.tag?.toString() || '';\n\t\tstr += '`';\n\t\tlet i = 0;\n\t\tfor (; i < this.quasis.length - 1; i++) {\n\t\t\tstr += this.quasis[i];\n\t\t\tstr += '${';\n\t\t\tstr += this.expressions[i].toString();\n\t\t\tstr += '}';\n\t\t}\n\t\tstr += this.quasis[i];\n\t\tstr += '`';\n\t\treturn str;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tquasis: this.quasis,\n\t\t\texpressions: this.expressions.map(expr => expr.toJSON()),\n\t\t\ttag: this.tag?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('TemplateLiteral')\nexport class TemplateLiteral extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TemplateLiteral, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TemplateLiteral(\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: undefined;\n\tconstructor(\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, undefined, range, loc);\n\t}\n\toverride getTag(): undefined {\n\t\treturn undefined;\n\t}\n}\n\n@Deserializer('TaggedTemplateExpression')\nexport class TaggedTemplateExpression extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TaggedTemplateExpression, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TaggedTemplateExpression(\n\t\t\tdeserializer(node.tag),\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: ExpressionNode;\n\tconstructor(\n\t\ttag: ExpressionNode,\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, tag, range, loc);\n\t}\n\toverride getTag(): ExpressionNode {\n\t\treturn super.getTag()!;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/expressions/api/definition/values.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;IAEU,UAAU;4BADtB,YAAY,CAAC,YAAY,CAAC;;;;sBACK,sBAAsB;0BAA9B,SAAQ,WAAsB;;;;YAAtD,6KA+CC;;;YA/CY,uDAAU;;QAIA,IAAI;QAH1B,MAAM,CAAC,QAAQ,CAAC,IAAgB;YAC/B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,CAAC;QACD,YAAsB,IAAqB,EAAE,KAAwB,EAAE,GAAoB;YAC1F,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YADG,SAAI,GAAJ,IAAI,CAAiB;QAE3C,CAAC;QACD,OAAO;YACN,OAAO,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,KAAU;YAC3B,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QACD,GAAG,CAAC,KAAY,EAAE,WAAiB;YAClC,IAAI,WAAW,EAAE;gBAChB,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YACD,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAGD,SAAS,CAAmB,KAAY,EAAE,KAAkB;YAC3D,IAAI,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;wCAArC,SAAQ,WAA6B;;;;YAA3E,6KAsBC;;;YAtBY,uDAAwB;;QACpC,MAAM,CAAC,QAAQ,CAAC,IAA8B,EAAE,YAA8B;YAC7E,OAAO,IAAI,wBAAwB,CAClC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EACtB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,EAClC,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,GAAG,CACR,CAAC;QACH,CAAC;QAED,YACC,GAAmB,EACnB,MAAgB,EAChB,WAA6B,EAC7B,KAAwB,EACxB,GAAoB;YACpB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;QACQ,MAAM;YACd,OAAO,KAAK,CAAC,MAAM,EAAG,CAAC;QACxB,CAAC;;;;SArBW,wBAAwB","sourcesContent":["import type {\n\tDeclarationExpression, ExpressionNode, NodeDeserializer,\n\tCanFindScope, ExpressionEventPath, VisitNodeType, SourceLocation\n} from '../expression.js';\nimport type { Context, Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode } from '../abstract.js';\n\n/**\n * An identifier is a sequence of characters in the code that identifies a variable, function, or property.\n * In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9),\n * but may not start with a digit.\n * An identifier differs from a string in that a string is data,\n * while an identifier is part of the code. In JavaScript,\n * there is no way to convert identifiers to strings,\n * but sometimes it is possible to parse strings into identifiers.\n */\n@Deserializer('Identifier')\nexport class Identifier extends AbstractExpressionNode implements DeclarationExpression, CanFindScope {\n\tstatic fromJSON(node: Identifier): Identifier {\n\t\treturn new Identifier(node.name, node.range, node.loc);\n\t}\n\tconstructor(protected name: string | number, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetName() {\n\t\treturn this.name;\n\t}\n\tset(stack: Stack, value: any) {\n\t\treturn stack.set(this.name, value) ? value : void 0;\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tif (thisContext) {\n\t\t\treturn thisContext[this.name];\n\t\t}\n\t\treturn stack.get(this.name);\n\t}\n\tfindScope<T extends object>(stack: Stack): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope: Scope<any>): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope?: Scope<any>): Scope<T> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.name);\n\t\t}\n\t\tscope = stack.findScope(this.name);\n\t\treturn scope.getInnerScope(this.name);\n\t}\n\tdeclareVariable(stack: Stack, propertyValue: any): any {\n\t\treturn stack.declareVariable(this.name, propertyValue);\n\t}\n\tgetDeclarationName(): string {\n\t\treturn this.toString();\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [this];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tconst path: ExpressionEventPath[] = [{ computed: false, path: this.toString() }];\n\t\treturn computed ? [{ computed, path: this.toString(), computedPath: [path] }] : path;\n\t}\n\ttoString(): string {\n\t\treturn String(this.name);\n\t}\n\ttoJson(): object {\n\t\treturn { name: this.name };\n\t}\n}\n\n@Deserializer('ThisExpression')\nexport class ThisExpression extends Identifier {\n\tstatic fromJSON(node: ThisExpression): ThisExpression {\n\t\treturn new ThisExpression(node.range, node.loc);\n\t}\n\tconstructor(\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper('this', range, loc);\n\t}\n\ttoJson(): object {\n\t\treturn {};\n\t}\n}\n\n@Deserializer('Literal')\nexport class Literal<T> extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: Literal<any>):\n\t\tLiteral<string>\n\t\t| Literal<number>\n\t\t| Literal<boolean>\n\t\t| Literal<RegExp>\n\t\t| Literal<bigint>\n\t\t| Literal<null>\n\t\t| Literal<undefined> {\n\t\tif (node.bigint) {\n\t\t\treturn new Literal(BigInt(node.bigint), node.raw, undefined, node.bigint, node.range, node.loc);\n\t\t} else if (node.regex) {\n\t\t\treturn new Literal(RegExp(node.regex.pattern, node.regex.flags), node.raw, node.regex, undefined, node.range, node.loc);\n\t\t}\n\t\treturn new Literal(node.value, node.raw, undefined, undefined, node.range, node.loc);\n\t}\n\tdeclare type: 'Literal';\n\tregex?: { pattern: string, flags: string };\n\tbigint?: string;\n\traw?: string\n\tconstructor(\n\t\tpublic value: T,\n\t\traw?: string,\n\t\tregex?: { pattern: string, flags: string },\n\t\tbigint?: string,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t\traw && (this.raw = raw);\n\t\tregex && (this.regex = regex);\n\t\tbigint && (this.bigint = bigint);\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tgetRegex() {\n\t\treturn this.regex;\n\t}\n\tgetBigint() {\n\t\treturn this.bigint;\n\t}\n\tgeRaw() {\n\t\treturn this.raw;\n\t}\n\tset() {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(): T {\n\t\treturn this.value;\n\t}\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.value as any);\n\t\t}\n\t\tscope = stack.findScope(this.value as any);\n\t\treturn scope.getInnerScope(this.value as any);\n\t}\n\tdependency(computed: true): ExpressionNode[] {\n\t\treturn computed ? [this] : [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn computed ? [{ computed: false, path: this.toString() }] : [];\n\t}\n\ttoString(): string {\n\t\treturn this.raw ?? String(this.value);\n\t}\n\ttoJson(): object {\n\t\tif (this.bigint) {\n\t\t\treturn {\n\t\t\t\tbigint: this.bigint,\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t} else if (this.regex) {\n\t\t\treturn {\n\t\t\t\tregex: { pattern: this.regex?.pattern, flags: this.regex?.flags },\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalue: this.value,\n\t\t\traw: this.raw,\n\t\t};\n\t}\n}\n\nclass TemplateArray extends Array<string> implements TemplateStringsArray {\n\traw: readonly string[];\n\tconstructor(strings: string[]) {\n\t\tsuper(...strings);\n\t\tthis.raw = strings;\n\t}\n}\n\nexport class TemplateLiteralExpressionNode extends AbstractExpressionNode {\n\tstatic visit(node: TemplateLiteralExpressionNode, visitNode: VisitNodeType): void {\n\t\tnode.tag && visitNode(node.tag);\n\t\tnode.expressions.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprotected quasis: string[],\n\t\tprotected expressions: ExpressionNode[],\n\t\tprotected tag?: ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetTag() {\n\t\treturn this.tag;\n\t}\n\tgetExpressions() {\n\t\treturn this.expressions;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`TemplateLiteralExpressionNode#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst tagged: Function = this.tag?.get(stack) || String.raw;\n\t\tconst templateStringsArray = new TemplateArray(this.quasis);\n\t\ttemplateStringsArray.raw = templateStringsArray;\n\t\tconst values = this.expressions.map(expr => expr.get(stack));\n\t\treturn tagged(templateStringsArray, ...values);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tlet str = this.tag?.toString() || '';\n\t\tstr += '`';\n\t\tlet i = 0;\n\t\tfor (; i < this.quasis.length - 1; i++) {\n\t\t\tstr += this.quasis[i];\n\t\t\tstr += '${';\n\t\t\tstr += this.expressions[i].toString();\n\t\t\tstr += '}';\n\t\t}\n\t\tstr += this.quasis[i];\n\t\tstr += '`';\n\t\treturn str;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tquasis: this.quasis,\n\t\t\texpressions: this.expressions.map(expr => expr.toJSON()),\n\t\t\ttag: this.tag?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('TemplateLiteral')\nexport class TemplateLiteral extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TemplateLiteral, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TemplateLiteral(\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: undefined;\n\tconstructor(\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, undefined, range, loc);\n\t}\n\toverride getTag(): undefined {\n\t\treturn undefined;\n\t}\n}\n\n@Deserializer('TaggedTemplateExpression')\nexport class TaggedTemplateExpression extends TemplateLiteralExpressionNode {\n\tstatic fromJSON(node: TaggedTemplateExpression, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TaggedTemplateExpression(\n\t\t\tdeserializer(node.tag),\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tdeclare protected tag: ExpressionNode;\n\tconstructor(\n\t\ttag: ExpressionNode,\n\t\tquasis: string[],\n\t\texpressions: ExpressionNode[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(quasis, expressions, tag, range, loc);\n\t}\n\toverride getTag(): ExpressionNode {\n\t\treturn super.getTag()!;\n\t}\n}\n"]}
|
package/api/module/common.js
CHANGED
|
@@ -19,15 +19,19 @@ export class ModuleSpecifier extends AbstractExpressionNode {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
let ImportAttribute = (() => {
|
|
23
23
|
let _classDecorators = [Deserializer('ImportAttribute')];
|
|
24
24
|
let _classDescriptor;
|
|
25
25
|
let _classExtraInitializers = [];
|
|
26
26
|
let _classThis;
|
|
27
|
-
|
|
27
|
+
let _classSuper = AbstractExpressionNode;
|
|
28
|
+
var ImportAttribute = class extends _classSuper {
|
|
29
|
+
static { _classThis = this; }
|
|
28
30
|
static {
|
|
29
|
-
|
|
31
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
32
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
30
33
|
ImportAttribute = _classThis = _classDescriptor.value;
|
|
34
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
31
35
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
32
36
|
}
|
|
33
37
|
key;
|
|
@@ -76,4 +80,5 @@ export let ImportAttribute = (() => {
|
|
|
76
80
|
};
|
|
77
81
|
return ImportAttribute = _classThis;
|
|
78
82
|
})();
|
|
83
|
+
export { ImportAttribute };
|
|
79
84
|
//# sourceMappingURL=common.js.map
|
package/api/module/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/common.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,OAAgB,eAAgB,SAAQ,sBAAsB;IAC7C;IAAtB,YAAsB,K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CAAC,GAAG,CAAC,MAAM,EAAE;gBACtB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;aAC1B,CAAC;QACH,CAAC;;;;SAjDW,eAAe","sourcesContent":["import type {\n\tExpressionEventPath, ExpressionNode, NodeDeserializer,\n\tSourceLocation, VisitNodeType\n} from '../expression.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\nexport abstract class ModuleSpecifier extends AbstractExpressionNode {\n\tconstructor(protected local: Identifier, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetLocal() {\n\t\treturn this.local;\n\t}\n\tgetLocalName() {\n\t\treturn this.local.getName();\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON()\n\t\t};\n\t}\n}\n\n\n\n@Deserializer('ImportAttribute')\nexport class ImportAttribute extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportAttribute, deserializer: NodeDeserializer): ImportAttribute {\n\t\treturn new ImportAttribute(\n\t\t\tdeserializer(node.key) as Identifier,\n\t\t\tdeserializer(node.value) as Literal<string>,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ImportAttribute, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.key);\n\t\tvisitNode(node.value);\n\t}\n\n\tconstructor(\n\t\tprivate key: Identifier | Literal<string>,\n\t\tprivate value: Literal<string>,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetKey() {\n\t\treturn this.key;\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any): { [key: string]: string } {\n\t\tconst key = this.key.get(stack);\n\t\tconst value = this.value.get();\n\t\treturn { [key]: value };\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\treturn `${this.key.toString()}: ${this.value.toString()}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tkey: this.key.toJSON(),\n\t\t\tvalue: this.value.toJSON(),\n\t\t};\n\t}\n}\n"]}
|
package/api/module/export.js
CHANGED
|
@@ -50,15 +50,19 @@ import { ModuleSpecifier } from './common.js';
|
|
|
50
50
|
* such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`,
|
|
51
51
|
* and the `local` field is an `Identifier` node representing `bar`.
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
let ExportSpecifier = (() => {
|
|
54
54
|
let _classDecorators = [Deserializer('ExportSpecifier')];
|
|
55
55
|
let _classDescriptor;
|
|
56
56
|
let _classExtraInitializers = [];
|
|
57
57
|
let _classThis;
|
|
58
|
-
|
|
58
|
+
let _classSuper = ModuleSpecifier;
|
|
59
|
+
var ExportSpecifier = class extends _classSuper {
|
|
60
|
+
static { _classThis = this; }
|
|
59
61
|
static {
|
|
60
|
-
|
|
62
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
63
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
61
64
|
ExportSpecifier = _classThis = _classDescriptor.value;
|
|
65
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
62
66
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
63
67
|
}
|
|
64
68
|
exported;
|
|
@@ -105,6 +109,7 @@ export let ExportSpecifier = (() => {
|
|
|
105
109
|
};
|
|
106
110
|
return ExportSpecifier = _classThis;
|
|
107
111
|
})();
|
|
112
|
+
export { ExportSpecifier };
|
|
108
113
|
/**
|
|
109
114
|
* An export named declaration, e.g.,
|
|
110
115
|
* `export {foo, bar};`,
|
|
@@ -113,16 +118,20 @@ export let ExportSpecifier = (() => {
|
|
|
113
118
|
*
|
|
114
119
|
* Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.
|
|
115
120
|
*/
|
|
116
|
-
|
|
117
|
-
let
|
|
118
|
-
let
|
|
119
|
-
let
|
|
120
|
-
let
|
|
121
|
-
|
|
121
|
+
let ExportNamedDeclaration = (() => {
|
|
122
|
+
let _classDecorators = [Deserializer('ExportNamedDeclaration')];
|
|
123
|
+
let _classDescriptor;
|
|
124
|
+
let _classExtraInitializers = [];
|
|
125
|
+
let _classThis;
|
|
126
|
+
let _classSuper = AbstractExpressionNode;
|
|
127
|
+
var ExportNamedDeclaration = class extends _classSuper {
|
|
128
|
+
static { _classThis = this; }
|
|
122
129
|
static {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
131
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
132
|
+
ExportNamedDeclaration = _classThis = _classDescriptor.value;
|
|
133
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
134
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
126
135
|
}
|
|
127
136
|
specifiers;
|
|
128
137
|
declaration;
|
|
@@ -256,23 +265,28 @@ export let ExportNamedDeclaration = (() => {
|
|
|
256
265
|
};
|
|
257
266
|
}
|
|
258
267
|
};
|
|
259
|
-
return ExportNamedDeclaration =
|
|
268
|
+
return ExportNamedDeclaration = _classThis;
|
|
260
269
|
})();
|
|
270
|
+
export { ExportNamedDeclaration };
|
|
261
271
|
/**
|
|
262
272
|
* An export default declaration, e.g.,
|
|
263
273
|
* `export default function () {};`
|
|
264
274
|
* or `export default 1;`.
|
|
265
275
|
*/
|
|
266
|
-
|
|
267
|
-
let
|
|
268
|
-
let
|
|
269
|
-
let
|
|
270
|
-
let
|
|
271
|
-
|
|
276
|
+
let ExportDefaultDeclaration = (() => {
|
|
277
|
+
let _classDecorators = [Deserializer('ExportDefaultDeclaration')];
|
|
278
|
+
let _classDescriptor;
|
|
279
|
+
let _classExtraInitializers = [];
|
|
280
|
+
let _classThis;
|
|
281
|
+
let _classSuper = AbstractExpressionNode;
|
|
282
|
+
var ExportDefaultDeclaration = class extends _classSuper {
|
|
283
|
+
static { _classThis = this; }
|
|
272
284
|
static {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
285
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
286
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
287
|
+
ExportDefaultDeclaration = _classThis = _classDescriptor.value;
|
|
288
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
289
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
276
290
|
}
|
|
277
291
|
declaration;
|
|
278
292
|
static fromJSON(node, deserializer) {
|
|
@@ -311,21 +325,26 @@ export let ExportDefaultDeclaration = (() => {
|
|
|
311
325
|
};
|
|
312
326
|
}
|
|
313
327
|
};
|
|
314
|
-
return ExportDefaultDeclaration =
|
|
328
|
+
return ExportDefaultDeclaration = _classThis;
|
|
315
329
|
})();
|
|
330
|
+
export { ExportDefaultDeclaration };
|
|
316
331
|
/**
|
|
317
332
|
* An export batch declaration, e.g., `export * from "mod";`.
|
|
318
333
|
*/
|
|
319
|
-
|
|
320
|
-
let
|
|
321
|
-
let
|
|
322
|
-
let
|
|
323
|
-
let
|
|
324
|
-
|
|
334
|
+
let ExportAllDeclaration = (() => {
|
|
335
|
+
let _classDecorators = [Deserializer('ExportAllDeclaration')];
|
|
336
|
+
let _classDescriptor;
|
|
337
|
+
let _classExtraInitializers = [];
|
|
338
|
+
let _classThis;
|
|
339
|
+
let _classSuper = AbstractExpressionNode;
|
|
340
|
+
var ExportAllDeclaration = class extends _classSuper {
|
|
341
|
+
static { _classThis = this; }
|
|
325
342
|
static {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
343
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
344
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
345
|
+
ExportAllDeclaration = _classThis = _classDescriptor.value;
|
|
346
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
347
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
329
348
|
}
|
|
330
349
|
source;
|
|
331
350
|
exported;
|
|
@@ -402,6 +421,7 @@ export let ExportAllDeclaration = (() => {
|
|
|
402
421
|
};
|
|
403
422
|
}
|
|
404
423
|
};
|
|
405
|
-
return ExportAllDeclaration =
|
|
424
|
+
return ExportAllDeclaration = _classThis;
|
|
406
425
|
})();
|
|
426
|
+
export { ExportAllDeclaration };
|
|
407
427
|
//# sourceMappingURL=export.js.map
|
package/api/module/export.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/export.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;AAMH,OAAO,EAAiB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAg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CAAC,CAAC,EAAE,GAAG,CAAC;QACxN,CAAC;QACD,MAAM;YACL,OAAO;gBACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;gBACjC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;aACjE,CAAC;QACH,CAAC;;WAlFW,oBAAoB","sourcesContent":["\n/**\n * There are two types of exports:\n * 1- Named Exports (Zero or more exports per module)\n * 2- Default Exports (One per module)\n * \n * // Exporting individual features\n * export let name1, name2, …, nameN; // also var, const\n * export let name1 = …, name2 = …, …, nameN; // also var, const\n * export function functionName(){...}\n * export class ClassName {...}\n * \n * // Export list\n * export { name1, name2, …, nameN };\n * \n * // Renaming exports\n * export { variable1 as name1, variable2 as name2, …, nameN };\n * \n * // Exporting destructed assignments with renaming\n * export const { name1, name2: bar } = o;\n * \n * // Default exports\n * export default expression;\n * export default function (…) { … } // also class, function*\n * export default function name1(…) { … } // also class, function*\n * export { name1 as default, … };\n * \n * // Aggregating modules\n * export * from …; // does not set the default export\n * export * as name1 from …; // Draft ECMAScript® 2O21\n * export { name1, name2, …, nameN } from …;\n * export { import1 as name1, import2 as name2, …, nameN } from …;\n * export { default, … } from …;\n */\n\nimport type {\n\tNodeDeserializer, ExpressionNode, ExpressionEventPath,\n\tVisitNodeType, DeclarationExpression, SourceLocation\n} from '../expression.js';\nimport { ModuleContext, ReactiveScope } from '../../scope/scope.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { ImportAttribute, ModuleSpecifier } from './common.js';\nimport { FunctionDeclaration } from '../definition/function.js';\nimport { ClassDeclaration } from '../class/class.js';\n\n\n/**\n * An exported variable binding, e.g., `{foo}` in `export {foo}` or `{bar as foo}` in `export {bar as foo}`.\n * \n * The `exported` field refers to the name exported in the module.\n * \n * The `local` field refers to the binding into the local module scope.\n * \n * If it is a basic named export, such as in `export {foo}`, both `exported` and `local` are equivalent `Identifier` nodes;\n * in this case an Identifier node representing `foo`.\n * \n * If it is an aliased export,\n * such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`,\n * and the `local` field is an `Identifier` node representing `bar`.\n */\n@Deserializer('ExportSpecifier')\nexport class ExportSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ExportSpecifier, deserializer: NodeDeserializer): ExportSpecifier {\n\t\treturn new ExportSpecifier(\n\t\t\tdeserializer(node.local) as Identifier,\n\t\t\tdeserializer(node.exported) as Identifier,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.exported);\n\t}\n\tconstructor(\n\t\tlocal: Identifier,\n\t\tprivate exported: Identifier,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(local, range, loc);\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\tconst local = this.local.toString();\n\t\tconst exported = this.exported.toString();\n\t\tif (local == exported) {\n\t\t\treturn local;\n\t\t}\n\t\treturn `${local} as ${exported}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON(),\n\t\t\texported: this.exported.toJSON()\n\t\t};\n\t}\n}\n\n\n/**\n * An export named declaration, e.g.,\n * `export {foo, bar};`,\n * `export {foo} from \"mod\";`\n * or `export var foo = 1;`.\n * \n * Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.\n */\n@Deserializer('ExportNamedDeclaration')\nexport class ExportNamedDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportNamedDeclaration, deserializer: NodeDeserializer): ExportNamedDeclaration {\n\t\treturn new ExportNamedDeclaration(\n\t\t\tnode.specifiers.map(deserializer) as ExportSpecifier[],\n\t\t\tnode.declaration ? deserializer(node.declaration) as DeclarationExpression : void 0,\n\t\t\tnode.source ? deserializer(node.source) as Literal<string> : void 0,\n\t\t\tnode.assertions ? node.assertions.map(deserializer) as ImportAttribute[] : void 0,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportNamedDeclaration, visitNode: VisitNodeType): void {\n\t\tnode.specifiers.map(visitNode);\n\t\tnode.source && visitNode(node.source);\n\t\tnode.declaration && visitNode(node.declaration);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate specifiers: ExportSpecifier[],\n\t\tprivate declaration?: DeclarationExpression,\n\t\tprivate source?: Literal<string>,\n\t\tprivate assertions?: ImportAttribute[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetSpecifiers() {\n\t\treturn this.specifiers;\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportNamedDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tif (this.declaration) {\n\t\t\tthis.exportDeclaration(stack);\n\t\t}\n\t\telse if (this.source) {\n\t\t\tthis.exportFromSource(stack);\n\t\t} else {\n\t\t\tthis.exportLocal(stack);\n\t\t}\n\t}\n\n\tprivate exportDeclaration(stack: Stack) {\n\t\tif (!this.declaration) {\n\t\t\treturn\n\t\t}\n\t\tthis.declaration.get(stack);\n\t\tconst declaredName = this.declaration.getDeclarationName?.();\n\t\tif (!declaredName) {\n\t\t\tthrow new Error(`Name is not defined for ${this.declaration.toString()}`);\n\t\t}\n\t\tconst value = stack.get(declaredName);\n\t\tstack.getModule()!.set(declaredName, value);\n\t}\n\tprivate exportFromSource(stack: Stack) {\n\t\tif (!this.source) {\n\t\t\treturn;\n\t\t}\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.assertions) {\n\t\t\tconst importAssertions: ImportAssertions = this.assertions\n\t\t\t\t.map(assertion => assertion.get(stack))\n\t\t\t\t.reduce((p, c) => Object.assign(p, c), {});\n\t\t\tif (importAssertions) {\n\t\t\t\timportCallOptions = { assert: importAssertions };\n\t\t\t}\n\t\t}\n\t\tconst sourceModule = stack.importModule(this.source.get(), importCallOptions);\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = sourceModule.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tprivate exportLocal(stack: Stack, importCallOptions?: ImportCallOptions) {\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = stack.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scope = stack.findScope(localName);\n\t\t\tif (scope instanceof ReactiveScope) {\n\t\t\t\tconst scopeSubscription = scope.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t}\n\t\t});\n\t}\n\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tif (this.declaration) {\n\t\t\tconst declaration = this.declaration.toString();\n\t\t\treturn `export ${declaration}`;\n\t\t}\n\t\tconst specifiers = this.specifiers.map(specifier => specifier.toString()).join(',');\n\t\tlet exportStr = `export {${specifiers}}`;\n\t\tif (!this.source) {\n\t\t\treturn `${exportStr};`;\n\t\t}\n\t\tconst source = this.source.toString();\n\t\treturn `${exportStr} from ${source}${this.assertions ? ` assert { ${this.assertions.map(assertion => assertion.toString()).join(', ')} }` : ''};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tspecifiers: this.specifiers.map(specifier => specifier.toJSON()),\n\t\t\tsource: this.source?.toJSON(),\n\t\t\tdeclaration: this.declaration?.toJSON(),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n\n\n/**\n * An export default declaration, e.g., \n * `export default function () {};`\n * or `export default 1;`.\n */\n@Deserializer('ExportDefaultDeclaration')\nexport class ExportDefaultDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportDefaultDeclaration, deserializer: NodeDeserializer): ExportDefaultDeclaration {\n\t\treturn new ExportDefaultDeclaration(\n\t\t\tdeserializer(node.declaration),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportDefaultDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.declaration);\n\t}\n\tconstructor(\n\t\tprivate declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst declaration = this.declaration.get(stack);\n\t\tstack.getModule()!.set('default', declaration);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tconst declaration = this.declaration.toString();\n\t\treturn `export default ${declaration}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tdeclaration: this.declaration.toJSON(),\n\t\t};\n\t}\n}\n\n/**\n * An export batch declaration, e.g., `export * from \"mod\";`.\n */\n@Deserializer('ExportAllDeclaration')\nexport class ExportAllDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportAllDeclaration, deserializer: NodeDeserializer): ExportAllDeclaration {\n\t\treturn new ExportAllDeclaration(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\tnode.exported ? deserializer(node.exported) as Identifier : void 0,\n\t\t\tnode.assertions?.map(deserializer) as ImportAttribute[],\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportAllDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.exported && visitNode(node.exported);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate source: Literal<string>,\n\t\tprivate exported?: Identifier,\n\t\tprivate assertions?: ImportAttribute[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.assertions) {\n\t\t\tconst importAssertions: ImportAssertions = this.assertions\n\t\t\t\t.map(assertion => assertion.get(stack))\n\t\t\t\t.reduce((p, c) => Object.assign(p, c), {});\n\t\t\tif (importAssertions) {\n\t\t\t\timportCallOptions = { assert: importAssertions };\n\t\t\t}\n\t\t}\n\t\tlet localModule: ReactiveScope<ModuleContext> = stack.getModule()!;\n\t\tconst sourceModule = stack.importModule(this.source.get(), importCallOptions);\n\n\t\tif (this.exported) {\n\t\t\tconst exportedName = this.exported.get(stack);\n\t\t\tlocalModule.set(exportedName, {});\n\t\t\tlocalModule = localModule.getInnerScope(exportedName)!;\n\t\t}\n\n\t\tconst properties = Object.keys(sourceModule.getContext()) as (keyof ModuleContext)[];\n\t\tproperties.forEach(property => {\n\n\t\t\tconst localValue = sourceModule.get(property);\n\t\t\tlocalModule.set(property, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(property, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(property, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\treturn `export *${this.exported ? ` as ${this.exported.toString()}` : ''} from ${this.source.toString()}${this.assertions ? ` assert { ${this.assertions.map(assertion => assertion.toString()).join(', ')} }` : ''};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tsource: this.source.toJSON(),\n\t\t\texported: this.exported?.toJSON(),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n"]}
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AAC,CAAC,aAAa,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACxN,CAAC;QACD,MAAM;YACL,OAAO;gBACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;gBACjC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;aACjE,CAAC;QACH,CAAC;;;;SAlFW,oBAAoB","sourcesContent":["\n/**\n * There are two types of exports:\n * 1- Named Exports (Zero or more exports per module)\n * 2- Default Exports (One per module)\n * \n * // Exporting individual features\n * export let name1, name2, …, nameN; // also var, const\n * export let name1 = …, name2 = …, …, nameN; // also var, const\n * export function functionName(){...}\n * export class ClassName {...}\n * \n * // Export list\n * export { name1, name2, …, nameN };\n * \n * // Renaming exports\n * export { variable1 as name1, variable2 as name2, …, nameN };\n * \n * // Exporting destructed assignments with renaming\n * export const { name1, name2: bar } = o;\n * \n * // Default exports\n * export default expression;\n * export default function (…) { … } // also class, function*\n * export default function name1(…) { … } // also class, function*\n * export { name1 as default, … };\n * \n * // Aggregating modules\n * export * from …; // does not set the default export\n * export * as name1 from …; // Draft ECMAScript® 2O21\n * export { name1, name2, …, nameN } from …;\n * export { import1 as name1, import2 as name2, …, nameN } from …;\n * export { default, … } from …;\n */\n\nimport type {\n\tNodeDeserializer, ExpressionNode, ExpressionEventPath,\n\tVisitNodeType, DeclarationExpression, SourceLocation\n} from '../expression.js';\nimport { ModuleContext, ReactiveScope } from '../../scope/scope.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { ImportAttribute, ModuleSpecifier } from './common.js';\nimport { FunctionDeclaration } from '../definition/function.js';\nimport { ClassDeclaration } from '../class/class.js';\n\n\n/**\n * An exported variable binding, e.g., `{foo}` in `export {foo}` or `{bar as foo}` in `export {bar as foo}`.\n * \n * The `exported` field refers to the name exported in the module.\n * \n * The `local` field refers to the binding into the local module scope.\n * \n * If it is a basic named export, such as in `export {foo}`, both `exported` and `local` are equivalent `Identifier` nodes;\n * in this case an Identifier node representing `foo`.\n * \n * If it is an aliased export,\n * such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`,\n * and the `local` field is an `Identifier` node representing `bar`.\n */\n@Deserializer('ExportSpecifier')\nexport class ExportSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ExportSpecifier, deserializer: NodeDeserializer): ExportSpecifier {\n\t\treturn new ExportSpecifier(\n\t\t\tdeserializer(node.local) as Identifier,\n\t\t\tdeserializer(node.exported) as Identifier,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.exported);\n\t}\n\tconstructor(\n\t\tlocal: Identifier,\n\t\tprivate exported: Identifier,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(local, range, loc);\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\tconst local = this.local.toString();\n\t\tconst exported = this.exported.toString();\n\t\tif (local == exported) {\n\t\t\treturn local;\n\t\t}\n\t\treturn `${local} as ${exported}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON(),\n\t\t\texported: this.exported.toJSON()\n\t\t};\n\t}\n}\n\n\n/**\n * An export named declaration, e.g.,\n * `export {foo, bar};`,\n * `export {foo} from \"mod\";`\n * or `export var foo = 1;`.\n * \n * Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.\n */\n@Deserializer('ExportNamedDeclaration')\nexport class ExportNamedDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportNamedDeclaration, deserializer: NodeDeserializer): ExportNamedDeclaration {\n\t\treturn new ExportNamedDeclaration(\n\t\t\tnode.specifiers.map(deserializer) as ExportSpecifier[],\n\t\t\tnode.declaration ? deserializer(node.declaration) as DeclarationExpression : void 0,\n\t\t\tnode.source ? deserializer(node.source) as Literal<string> : void 0,\n\t\t\tnode.assertions ? node.assertions.map(deserializer) as ImportAttribute[] : void 0,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportNamedDeclaration, visitNode: VisitNodeType): void {\n\t\tnode.specifiers.map(visitNode);\n\t\tnode.source && visitNode(node.source);\n\t\tnode.declaration && visitNode(node.declaration);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate specifiers: ExportSpecifier[],\n\t\tprivate declaration?: DeclarationExpression,\n\t\tprivate source?: Literal<string>,\n\t\tprivate assertions?: ImportAttribute[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetSpecifiers() {\n\t\treturn this.specifiers;\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportNamedDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tif (this.declaration) {\n\t\t\tthis.exportDeclaration(stack);\n\t\t}\n\t\telse if (this.source) {\n\t\t\tthis.exportFromSource(stack);\n\t\t} else {\n\t\t\tthis.exportLocal(stack);\n\t\t}\n\t}\n\n\tprivate exportDeclaration(stack: Stack) {\n\t\tif (!this.declaration) {\n\t\t\treturn\n\t\t}\n\t\tthis.declaration.get(stack);\n\t\tconst declaredName = this.declaration.getDeclarationName?.();\n\t\tif (!declaredName) {\n\t\t\tthrow new Error(`Name is not defined for ${this.declaration.toString()}`);\n\t\t}\n\t\tconst value = stack.get(declaredName);\n\t\tstack.getModule()!.set(declaredName, value);\n\t}\n\tprivate exportFromSource(stack: Stack) {\n\t\tif (!this.source) {\n\t\t\treturn;\n\t\t}\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.assertions) {\n\t\t\tconst importAssertions: ImportAssertions = this.assertions\n\t\t\t\t.map(assertion => assertion.get(stack))\n\t\t\t\t.reduce((p, c) => Object.assign(p, c), {});\n\t\t\tif (importAssertions) {\n\t\t\t\timportCallOptions = { assert: importAssertions };\n\t\t\t}\n\t\t}\n\t\tconst sourceModule = stack.importModule(this.source.get(), importCallOptions);\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = sourceModule.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tprivate exportLocal(stack: Stack, importCallOptions?: ImportCallOptions) {\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = stack.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scope = stack.findScope(localName);\n\t\t\tif (scope instanceof ReactiveScope) {\n\t\t\t\tconst scopeSubscription = scope.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t}\n\t\t});\n\t}\n\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tif (this.declaration) {\n\t\t\tconst declaration = this.declaration.toString();\n\t\t\treturn `export ${declaration}`;\n\t\t}\n\t\tconst specifiers = this.specifiers.map(specifier => specifier.toString()).join(',');\n\t\tlet exportStr = `export {${specifiers}}`;\n\t\tif (!this.source) {\n\t\t\treturn `${exportStr};`;\n\t\t}\n\t\tconst source = this.source.toString();\n\t\treturn `${exportStr} from ${source}${this.assertions ? ` assert { ${this.assertions.map(assertion => assertion.toString()).join(', ')} }` : ''};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tspecifiers: this.specifiers.map(specifier => specifier.toJSON()),\n\t\t\tsource: this.source?.toJSON(),\n\t\t\tdeclaration: this.declaration?.toJSON(),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n\n\n/**\n * An export default declaration, e.g., \n * `export default function () {};`\n * or `export default 1;`.\n */\n@Deserializer('ExportDefaultDeclaration')\nexport class ExportDefaultDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportDefaultDeclaration, deserializer: NodeDeserializer): ExportDefaultDeclaration {\n\t\treturn new ExportDefaultDeclaration(\n\t\t\tdeserializer(node.declaration),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportDefaultDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.declaration);\n\t}\n\tconstructor(\n\t\tprivate declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst declaration = this.declaration.get(stack);\n\t\tstack.getModule()!.set('default', declaration);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tconst declaration = this.declaration.toString();\n\t\treturn `export default ${declaration}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tdeclaration: this.declaration.toJSON(),\n\t\t};\n\t}\n}\n\n/**\n * An export batch declaration, e.g., `export * from \"mod\";`.\n */\n@Deserializer('ExportAllDeclaration')\nexport class ExportAllDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportAllDeclaration, deserializer: NodeDeserializer): ExportAllDeclaration {\n\t\treturn new ExportAllDeclaration(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\tnode.exported ? deserializer(node.exported) as Identifier : void 0,\n\t\t\tnode.assertions?.map(deserializer) as ImportAttribute[],\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportAllDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.exported && visitNode(node.exported);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate source: Literal<string>,\n\t\tprivate exported?: Identifier,\n\t\tprivate assertions?: ImportAttribute[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.assertions) {\n\t\t\tconst importAssertions: ImportAssertions = this.assertions\n\t\t\t\t.map(assertion => assertion.get(stack))\n\t\t\t\t.reduce((p, c) => Object.assign(p, c), {});\n\t\t\tif (importAssertions) {\n\t\t\t\timportCallOptions = { assert: importAssertions };\n\t\t\t}\n\t\t}\n\t\tlet localModule: ReactiveScope<ModuleContext> = stack.getModule()!;\n\t\tconst sourceModule = stack.importModule(this.source.get(), importCallOptions);\n\n\t\tif (this.exported) {\n\t\t\tconst exportedName = this.exported.get(stack);\n\t\t\tlocalModule.set(exportedName, {});\n\t\t\tlocalModule = localModule.getInnerScope(exportedName)!;\n\t\t}\n\n\t\tconst properties = Object.keys(sourceModule.getContext()) as (keyof ModuleContext)[];\n\t\tproperties.forEach(property => {\n\n\t\t\tconst localValue = sourceModule.get(property);\n\t\t\tlocalModule.set(property, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(property, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(property, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\treturn `export *${this.exported ? ` as ${this.exported.toString()}` : ''} from ${this.source.toString()}${this.assertions ? ` assert { ${this.assertions.map(assertion => assertion.toString()).join(', ')} }` : ''};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tsource: this.source.toJSON(),\n\t\t\texported: this.exported?.toJSON(),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n"]}
|