@ibyar/expressions 0.8.2-dev.20221008 → 0.8.3
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/api/abstract.d.ts +0 -3
- package/api/abstract.js +0 -4
- package/api/abstract.js.map +1 -1
- package/api/class/class.d.ts +85 -43
- package/api/class/class.js +237 -173
- package/api/class/class.js.map +1 -1
- package/api/class/decorator.d.ts +0 -2
- package/api/class/decorator.js +0 -3
- package/api/class/decorator.js.map +1 -1
- package/api/computing/call.d.ts +0 -2
- package/api/computing/call.js +0 -3
- package/api/computing/call.js.map +1 -1
- package/api/computing/debugger.d.ts +0 -2
- package/api/computing/debugger.js +0 -2
- package/api/computing/debugger.js.map +1 -1
- package/api/computing/new.d.ts +0 -2
- package/api/computing/new.js +0 -3
- package/api/computing/new.js.map +1 -1
- package/api/computing/rest.d.ts +0 -2
- package/api/computing/rest.js +0 -3
- package/api/computing/rest.js.map +1 -1
- package/api/computing/return.d.ts +0 -2
- package/api/computing/return.js +0 -3
- package/api/computing/return.js.map +1 -1
- package/api/computing/spread.d.ts +0 -2
- package/api/computing/spread.js +0 -3
- package/api/computing/spread.js.map +1 -1
- package/api/computing/throw.d.ts +0 -4
- package/api/computing/throw.js +0 -5
- package/api/computing/throw.js.map +1 -1
- package/api/computing/yield.d.ts +0 -2
- package/api/computing/yield.js +0 -3
- package/api/computing/yield.js.map +1 -1
- package/api/definition/array.d.ts +0 -3
- package/api/definition/array.js +0 -4
- package/api/definition/array.js.map +1 -1
- package/api/definition/bind.d.ts +0 -1
- package/api/definition/bind.js +0 -1
- package/api/definition/bind.js.map +1 -1
- package/api/definition/comment.d.ts +0 -2
- package/api/definition/comment.js +0 -1
- package/api/definition/comment.js.map +1 -1
- package/api/definition/function.d.ts +3 -11
- package/api/definition/function.js +33 -56
- package/api/definition/function.js.map +1 -1
- package/api/definition/member.d.ts +0 -1
- package/api/definition/member.js +1 -2
- package/api/definition/member.js.map +1 -1
- package/api/definition/object.d.ts +1 -5
- package/api/definition/object.js +2 -8
- package/api/definition/object.js.map +1 -1
- package/api/definition/statement.d.ts +0 -2
- package/api/definition/statement.js +0 -3
- package/api/definition/statement.js.map +1 -1
- package/api/definition/values.d.ts +0 -3
- package/api/definition/values.js +0 -5
- package/api/definition/values.js.map +1 -1
- package/api/expression.d.ts +0 -20
- package/api/expression.js.map +1 -1
- package/api/module/common.d.ts +1 -2
- package/api/module/common.js +3 -3
- package/api/module/common.js.map +1 -1
- package/api/module/export.d.ts +0 -5
- package/api/module/export.js +5 -9
- package/api/module/export.js.map +1 -1
- package/api/module/import.d.ts +2 -6
- package/api/module/import.js +4 -9
- package/api/module/import.js.map +1 -1
- package/api/operators/await.d.ts +0 -2
- package/api/operators/await.js +0 -3
- package/api/operators/await.js.map +1 -1
- package/api/operators/chaining.d.ts +0 -1
- package/api/operators/chaining.js +0 -1
- package/api/operators/chaining.js.map +1 -1
- package/api/operators/comma.d.ts +0 -2
- package/api/operators/comma.js +0 -3
- package/api/operators/comma.js.map +1 -1
- package/api/operators/grouping.d.ts +0 -2
- package/api/operators/grouping.js +0 -3
- package/api/operators/grouping.js.map +1 -1
- package/api/operators/pipeline.d.ts +1 -3
- package/api/operators/pipeline.js +0 -7
- package/api/operators/pipeline.js.map +1 -1
- package/api/operators/ternary.d.ts +0 -2
- package/api/operators/ternary.js +0 -5
- package/api/operators/ternary.js.map +1 -1
- package/api/operators/unary.d.ts +0 -2
- package/api/operators/unary.js +0 -3
- package/api/operators/unary.js.map +1 -1
- package/api/operators/update.d.ts +0 -2
- package/api/operators/update.js +0 -3
- package/api/operators/update.js.map +1 -1
- package/api/program.d.ts +0 -2
- package/api/program.js +0 -1
- package/api/program.js.map +1 -1
- package/api/statement/control/block.d.ts +0 -2
- package/api/statement/control/block.js +3 -8
- package/api/statement/control/block.js.map +1 -1
- package/api/statement/control/empty.d.ts +0 -2
- package/api/statement/control/empty.js +0 -1
- package/api/statement/control/empty.js.map +1 -1
- package/api/statement/control/if.d.ts +0 -2
- package/api/statement/control/if.js +0 -5
- package/api/statement/control/if.js.map +1 -1
- package/api/statement/control/switch.d.ts +0 -3
- package/api/statement/control/switch.js +0 -8
- package/api/statement/control/switch.js.map +1 -1
- package/api/statement/control/terminate.d.ts +0 -3
- package/api/statement/control/terminate.js +0 -4
- package/api/statement/control/terminate.js.map +1 -1
- package/api/statement/declarations/declares.d.ts +1 -4
- package/api/statement/declarations/declares.js +0 -6
- package/api/statement/declarations/declares.js.map +1 -1
- package/api/statement/iterations/for.d.ts +1 -6
- package/api/statement/iterations/for.js +0 -18
- package/api/statement/iterations/for.js.map +1 -1
- package/api/statement/iterations/while.d.ts +0 -3
- package/api/statement/iterations/while.js +0 -8
- package/api/statement/iterations/while.js.map +1 -1
- package/package.json +2 -2
- package/scope/scope.d.ts +6 -22
- package/scope/scope.js +12 -59
- package/scope/scope.js.map +1 -1
- package/scope/stack.d.ts +15 -3
- package/scope/stack.js +26 -9
- package/scope/stack.js.map +1 -1
- package/v8/inline.d.ts +3 -1
- package/v8/inline.js +29 -16
- package/v8/inline.js.map +1 -1
- package/v8/nodes.d.ts +1 -1
package/api/expression.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../src/expressions/api/expression.ts"],"names":[],"mappings":"","sourcesContent":["import type { Scope, Context } from '../scope/scope.js';\nimport type { Stack } from '../scope/stack.js';\nimport { TypeOf } from './utils.js';\n\nexport type NodeType = { type: string };\nexport type NodeJsonType = { [key: string]: any } & NodeType;\n\nexport type ExpressionEventPathDotNotation = { computed: false, path: string };\nexport type ExpressionEventPathBracketNotation = { computed: true, path: string, computedPath: ExpressionEventPath[][] };\nexport type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEventPathBracketNotation;\nexport type ExpressionEventMap = { [key: string]: ExpressionEventMap };\n\nexport interface ExpressionNode {\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"expression.js","sourceRoot":"","sources":["../../../src/expressions/api/expression.ts"],"names":[],"mappings":"","sourcesContent":["import type { Scope, Context } from '../scope/scope.js';\nimport type { Stack } from '../scope/stack.js';\nimport { TypeOf } from './utils.js';\n\nexport type NodeType = { type: string };\nexport type NodeJsonType = { [key: string]: any } & NodeType;\n\nexport type ExpressionEventPathDotNotation = { computed: false, path: string };\nexport type ExpressionEventPathBracketNotation = { computed: true, path: string, computedPath: ExpressionEventPath[][] };\nexport type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEventPathBracketNotation;\nexport type ExpressionEventMap = { [key: string]: ExpressionEventMap };\n\nexport interface ExpressionNode {\n\n\t/**\n\t * assign the value to this expression in stack.\n\t * \n\t * most ExpressionNode will not implement this method, and will throw an exception.\n\t * @param stack \n\t * @param value \n\t */\n\tset(stack: Stack, value: any): any;\n\n\t/**\n\t * execute/get the code for this expression and return the result value.\n\t * @param stack \n\t * @param thisContext \n\t */\n\tget(stack: Stack, thisContext?: any): any;\n\n\t/**\n\t * get all dependencies form an expression node\n\t *\n\t * the return from this method, is represent an answer for what identifiers this expression depends-on.\n\t * \n\t *\n\t * ex:\n\t * ```js\n\t * x + y;\n\t * ```\n\t *\n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier:\tthe answer should be node `x`,\n\t * - for `y` identifier:\tthe answer should be node `y`.\n\t *\n\t * so, the return from `+` will be `[ node 'x', node 'y']`\n\t *\n\t * and:\n\t * - `x.y.z * a` ==> `[ member node `x.y.z`, identifier 'a']`\n\t * @param computed\n\t */\n\tdependency(computed?: true): ExpressionNode[];\n\n\t/**\n\t * ex:\n\t * ```js\n\t * x + y;\n\t * ```\n\t *\n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier:\tthe answer should be node `x`,\n\t * - for `y` identifier:\tthe answer should be node `y`.\n\t *\n\t * so, the return from `+` will be `['x', 'y']`\n\t *\n\t * and:\n\t * - `x.y.z` ==> `['x', 'y', 'z']`\n\t * - `x[y].z` ==> ['x', ]\n\t * @param computed required for member and chaining operators\n\t */\n\tdependencyPath(computed?: true): ExpressionEventPath[];\n\n\t/**\n\t * get all the events form this expression\n\t * \n\t * the return from this method, is represent an answer for what is this expression depends-on as identifier name\n\t * \n\t * ex: \n\t * ```js\n\t * x + y;\n\t * ```\n\t * \n\t * - for `+` operator :\tthe answer should be `lhs` and `rhs`,\n\t * - for `x` identifier: the answer should be `x`\n\t * - for `y` identifier: the answer should be `y`\n\t * the final output will be \n\t * \n\t * so, the return from `+` will be `{ x: undefined, y: undefined }`\n\t * \n\t * and:\n\t * - `x.y.z * a` ==> `{ x: { y: { z: undefined }, a: undefined } }`\n\t * - `x.y.z > x.y.h.g` ==> `{ x: { y: { z: undefined, h: { g: undefined} } } }`\n\t * - `x[Symbol.toStringTag] + 'Class' + classType + array[3]` ==> `{ x: { 'Symbol.toStringTag': undefined }, classType: undefined, array: { 3: undefined } }`\n\t * - `'name'` ==> {}\n\t * - ```js\n\t * user[firstName + `son of ${fatherName}`]\n\t * ``` ==> `{ user: { 'firstName:fatherName': undefined }, firstName: undefined, fatherName: undefined }`\n\t * @param parent \n\t */\n\tevents(): ExpressionEventMap;\n\n\n\t/**\n\t * re-write this expression as a javascript source \n\t */\n\ttoString(): string;\n\n\t/**\n\t * used to map this object to represent an [ESTree](https://github.com/estree/estree) json object\n\t * @param key \n\t */\n\ttoJSON(): NodeJsonType;\n\n\t/**\n\t * just a helper method to force class that implement this interface to\n\t * have a static method `fromJSON` to help reconstruct this ExpressionNode\n\t * from an [ESTree](https://github.com/estree/estree) json object,\n\t * with all necessary implementation to execute the code\n\t */\n\tgetClass(): ExpressionNodConstructor<ExpressionNode>;\n}\n\nexport type NodeDeserializer<N = ExpressionNode> = (node: N) => N;\n\nexport type VisitNodeType = (expression: ExpressionNode) => void;\n\n/**\n * this is how to:\n * describe a class with it's static functions and properties\n * in the interface add getClass method\n */\nexport interface ExpressionNodConstructor<N extends ExpressionNode> extends TypeOf<N> {\n\n\t/**\n\t * the type of an expression\n\t */\n\ttype: string;\n\n\t/**\n\t * build expression node from [ESTree](https://github.com/estree/estree) json object\n\t * @param node \n\t * @param deserializer \n\t */\n\tfromJSON(node: N, deserializer: NodeDeserializer): N;\n\n\t/**\n\t * visit nodes inside expression\n\t * @param expression \n\t * @param callback \n\t */\n\tvisit?(node: N, visitNode: Object): void;\n}\n\nexport interface DeclarationExpression extends ExpressionNode {\n\t/**\n\t * declare variable in the current local scope (block),\n\t * or closest function scope (global) scop,\n\t * the propertyName will be calculated at runtime\n\t * @param stack the stack which an identifier will be declared\n\t * @param propertyValue the initial value of identifier\n\t * @param scope which scop to declare this identifier\n\t */\n\tdeclareVariable(stack: Stack, propertyValue?: any): any;\n\n\t/**\n\t * get the variable declaration name\n\t */\n\tgetDeclarationName?(): string;\n}\n\n\n/**\n * An interface meant to be implemented by MemberExpression,\n * Identifier and ChainExpression and all Literal expressions\n */\nexport interface CanFindScope {\n\t/**\n\t * try to search for scope of this expression\n\t * @param stack \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}\n"]}
|
package/api/module/common.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Scope } from '../../scope/scope.js';
|
|
2
1
|
import { Stack } from '../../scope/stack.js';
|
|
3
2
|
import { AbstractExpressionNode } from '../abstract.js';
|
|
4
3
|
import { Identifier, Literal } from '../definition/values.js';
|
|
@@ -7,6 +6,7 @@ export declare abstract class ModuleSpecifier extends AbstractExpressionNode {
|
|
|
7
6
|
protected local: Identifier;
|
|
8
7
|
constructor(local: Identifier);
|
|
9
8
|
getLocal(): Identifier;
|
|
9
|
+
getLocalName(): string | number;
|
|
10
10
|
toJson(): object;
|
|
11
11
|
}
|
|
12
12
|
export declare class ImportAttribute extends AbstractExpressionNode {
|
|
@@ -17,7 +17,6 @@ export declare class ImportAttribute extends AbstractExpressionNode {
|
|
|
17
17
|
constructor(key: Identifier | Literal<string>, value: Literal<string>);
|
|
18
18
|
getKey(): Identifier | Literal<string>;
|
|
19
19
|
getValue(): Literal<string>;
|
|
20
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
21
20
|
set(stack: Stack, value: any): void;
|
|
22
21
|
get(stack: Stack, thisContext?: any): {
|
|
23
22
|
[key: string]: string;
|
package/api/module/common.js
CHANGED
|
@@ -11,6 +11,9 @@ export class ModuleSpecifier extends AbstractExpressionNode {
|
|
|
11
11
|
getLocal() {
|
|
12
12
|
return this.local;
|
|
13
13
|
}
|
|
14
|
+
getLocalName() {
|
|
15
|
+
return this.local.getName();
|
|
16
|
+
}
|
|
14
17
|
toJson() {
|
|
15
18
|
return {
|
|
16
19
|
local: this.local.toJSON()
|
|
@@ -36,9 +39,6 @@ let ImportAttribute = ImportAttribute_1 = class ImportAttribute extends Abstract
|
|
|
36
39
|
getValue() {
|
|
37
40
|
return this.value;
|
|
38
41
|
}
|
|
39
|
-
shareVariables(scopeList) {
|
|
40
|
-
throw new Error('Method not implemented.');
|
|
41
|
-
}
|
|
42
42
|
set(stack, value) {
|
|
43
43
|
throw new Error('Method not implemented.');
|
|
44
44
|
}
|
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":";;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/common.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAc,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,MAAM,OAAgB,eAAgB,SAAQ,sBAAsB;IACnE,YAAsB,KAAi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CAAC;QAC/B,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,UAAU,CAAC,QAAe;QACzB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,QAAQ;QACP,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC3D,CAAC;IACD,MAAM;QACL,OAAO;YACN,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACtB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;SAC1B,CAAC;IACH,CAAC;CACD,CAAA;AA5CY,eAAe;IAD3B,YAAY,CAAC,iBAAiB,CAAC;6CAauC,OAAO;GAZjE,eAAe,CA4C3B;SA5CY,eAAe","sourcesContent":["import { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { ExpressionEventPath, ExpressionNode, NodeDeserializer, VisitNodeType } from '../expression.js';\n\nexport abstract class ModuleSpecifier extends AbstractExpressionNode {\n\tconstructor(protected local: Identifier) {\n\t\tsuper();\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);\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(private key: Identifier | Literal<string>, private value: Literal<string>) {\n\t\tsuper();\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.d.ts
CHANGED
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
* export { default, … } from …;
|
|
33
33
|
*/
|
|
34
34
|
import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType, DeclarationExpression } from '../expression.js';
|
|
35
|
-
import { Scope } from '../../scope/scope.js';
|
|
36
35
|
import { Stack } from '../../scope/stack.js';
|
|
37
36
|
import { AbstractExpressionNode } from '../abstract.js';
|
|
38
37
|
import { Identifier, Literal } from '../definition/values.js';
|
|
@@ -59,7 +58,6 @@ export declare class ExportSpecifier extends ModuleSpecifier {
|
|
|
59
58
|
static visit(node: ExportSpecifier, visitNode: VisitNodeType): void;
|
|
60
59
|
constructor(local: Identifier, exported: Identifier);
|
|
61
60
|
getExported(): Identifier;
|
|
62
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
63
61
|
set(stack: Stack, value: any): void;
|
|
64
62
|
get(stack: Stack, thisContext?: any): void;
|
|
65
63
|
dependency(computed?: true): ExpressionNode[];
|
|
@@ -87,7 +85,6 @@ export declare class ExportNamedDeclaration extends AbstractExpressionNode {
|
|
|
87
85
|
getSpecifiers(): ExportSpecifier[];
|
|
88
86
|
getDeclaration(): DeclarationExpression | undefined;
|
|
89
87
|
getAssertions(): ImportAttribute[] | undefined;
|
|
90
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
91
88
|
set(stack: Stack): void;
|
|
92
89
|
get(stack: Stack): void;
|
|
93
90
|
private exportDeclaration;
|
|
@@ -109,7 +106,6 @@ export declare class ExportDefaultDeclaration extends AbstractExpressionNode {
|
|
|
109
106
|
static visit(node: ExportDefaultDeclaration, visitNode: VisitNodeType): void;
|
|
110
107
|
constructor(declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode);
|
|
111
108
|
getDeclaration(): ExpressionNode | FunctionDeclaration | ClassDeclaration;
|
|
112
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
113
109
|
set(stack: Stack): void;
|
|
114
110
|
get(stack: Stack): void;
|
|
115
111
|
dependency(computed?: true): ExpressionNode[];
|
|
@@ -130,7 +126,6 @@ export declare class ExportAllDeclaration extends AbstractExpressionNode {
|
|
|
130
126
|
getSource(): Literal<string>;
|
|
131
127
|
getExported(): Identifier | undefined;
|
|
132
128
|
getAssertions(): ImportAttribute[] | undefined;
|
|
133
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
134
129
|
set(stack: Stack): void;
|
|
135
130
|
get(stack: Stack): void;
|
|
136
131
|
dependency(computed?: true): ExpressionNode[];
|
package/api/module/export.js
CHANGED
|
@@ -67,8 +67,6 @@ let ExportSpecifier = ExportSpecifier_1 = class ExportSpecifier extends ModuleSp
|
|
|
67
67
|
getExported() {
|
|
68
68
|
return this.exported;
|
|
69
69
|
}
|
|
70
|
-
shareVariables(scopeList) {
|
|
71
|
-
}
|
|
72
70
|
set(stack, value) {
|
|
73
71
|
throw new Error('Method not implemented.');
|
|
74
72
|
}
|
|
@@ -138,7 +136,6 @@ let ExportNamedDeclaration = ExportNamedDeclaration_1 = class ExportNamedDeclara
|
|
|
138
136
|
getAssertions() {
|
|
139
137
|
return this.assertions;
|
|
140
138
|
}
|
|
141
|
-
shareVariables(scopeList) { }
|
|
142
139
|
set(stack) {
|
|
143
140
|
throw new Error(`ExportNamedDeclaration.#set() has no implementation.`);
|
|
144
141
|
}
|
|
@@ -157,12 +154,13 @@ let ExportNamedDeclaration = ExportNamedDeclaration_1 = class ExportNamedDeclara
|
|
|
157
154
|
if (!this.declaration) {
|
|
158
155
|
return;
|
|
159
156
|
}
|
|
160
|
-
|
|
161
|
-
const declaredName = this.declaration.getDeclarationName();
|
|
157
|
+
this.declaration.get(stack);
|
|
158
|
+
const declaredName = this.declaration.getDeclarationName?.();
|
|
162
159
|
if (!declaredName) {
|
|
163
|
-
throw new Error(`Name is not defined for ${declaration.toString()}`);
|
|
160
|
+
throw new Error(`Name is not defined for ${this.declaration.toString()}`);
|
|
164
161
|
}
|
|
165
|
-
stack.
|
|
162
|
+
const value = stack.get(declaredName);
|
|
163
|
+
stack.getModule().set(declaredName, value);
|
|
166
164
|
}
|
|
167
165
|
exportFromSource(stack) {
|
|
168
166
|
if (!this.source) {
|
|
@@ -262,7 +260,6 @@ let ExportDefaultDeclaration = ExportDefaultDeclaration_1 = class ExportDefaultD
|
|
|
262
260
|
getDeclaration() {
|
|
263
261
|
return this.declaration;
|
|
264
262
|
}
|
|
265
|
-
shareVariables(scopeList) { }
|
|
266
263
|
set(stack) {
|
|
267
264
|
throw new Error(`ExportDefaultDeclaration.#set() has no implementation.`);
|
|
268
265
|
}
|
|
@@ -318,7 +315,6 @@ let ExportAllDeclaration = ExportAllDeclaration_1 = class ExportAllDeclaration e
|
|
|
318
315
|
getAssertions() {
|
|
319
316
|
return this.assertions;
|
|
320
317
|
}
|
|
321
|
-
shareVariables(scopeList) { }
|
|
322
318
|
set(stack) {
|
|
323
319
|
throw new Error(`ExportDefaultDeclaration.#set() has no implementation.`);
|
|
324
320
|
}
|
package/api/module/export.js.map
CHANGED
|
@@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AS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;SACjE,CAAC;IACH,CAAC;CACD,CAAA;AAhFY,oBAAoB;IADhC,YAAY,CAAC,sBAAsB,CAAC;qCAenB,OAAO;QACJ,UAAU;GAflB,oBAAoB,CAgFhC;SAhFY,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,\n\tExpressionEventPath, VisitNodeType, DeclarationExpression\n} from '../expression.js';\nimport { ModuleContext, ReactiveScope, Scope } 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);\n\t}\n\tstatic visit(node: ExportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.exported);\n\t}\n\tconstructor(local: Identifier, private exported: Identifier) {\n\t\tsuper(local);\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void {\n\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);\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\tsuper();\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\tshareVariables(scopeList: Scope<any>[]): void { }\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\tconst declaration = this.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 ${declaration.toString()}`);\n\t\t}\n\t\tstack.getModule()!.set(declaredName, declaration);\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(deserializer(node.declaration));\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\tsuper();\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\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);\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\tsuper();\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\tshareVariables(scopeList: Scope<any>[]): void { }\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"]}
|
|
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,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAA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iBAAiB,CAAC,WAAW,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,UAAU,CAAC,QAAe;QACzB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,QAAQ;QACP,OAAO,WAAW,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,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;IACxN,CAAC;IACD,MAAM;QACL,OAAO;YACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;YACjC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;SACjE,CAAC;IACH,CAAC;CACD,CAAA;AA/EY,oBAAoB;IADhC,YAAY,CAAC,sBAAsB,CAAC;qCAenB,OAAO;QACJ,UAAU;GAflB,oBAAoB,CA+EhC;SA/EY,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,\n\tExpressionEventPath, VisitNodeType, DeclarationExpression\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);\n\t}\n\tstatic visit(node: ExportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.exported);\n\t}\n\tconstructor(local: Identifier, private exported: Identifier) {\n\t\tsuper(local);\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);\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\tsuper();\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(deserializer(node.declaration));\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\tsuper();\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);\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\tsuper();\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"]}
|
package/api/module/import.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType } from '../expression.js';
|
|
2
|
-
import type { ModuleScope
|
|
2
|
+
import type { ModuleScope } from '../../scope/scope.js';
|
|
3
3
|
import type { Stack } from '../../scope/stack.js';
|
|
4
4
|
import { AbstractExpressionNode } from '../abstract.js';
|
|
5
5
|
import { Identifier, Literal } from '../definition/values.js';
|
|
@@ -27,7 +27,7 @@ export declare class ImportSpecifier extends ModuleSpecifier {
|
|
|
27
27
|
static visit(node: ImportSpecifier, visitNode: VisitNodeType): void;
|
|
28
28
|
constructor(local: Identifier, imported: Identifier);
|
|
29
29
|
getImported(): Identifier;
|
|
30
|
-
|
|
30
|
+
getImportedName(): string | number;
|
|
31
31
|
set(stack: Stack, value: any): void;
|
|
32
32
|
get(stack: Stack, thisContext?: any): void;
|
|
33
33
|
dependency(computed?: true): ExpressionNode[];
|
|
@@ -41,7 +41,6 @@ export declare class ImportSpecifier extends ModuleSpecifier {
|
|
|
41
41
|
export declare class ImportDefaultSpecifier extends ModuleSpecifier {
|
|
42
42
|
static fromJSON(node: ImportDefaultSpecifier, deserializer: NodeDeserializer): ImportDefaultSpecifier;
|
|
43
43
|
static visit(node: ImportDefaultSpecifier, visitNode: VisitNodeType): void;
|
|
44
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
45
44
|
set(stack: Stack, value: any): void;
|
|
46
45
|
get(stack: Stack, thisContext?: any): void;
|
|
47
46
|
dependency(computed?: true): ExpressionNode[];
|
|
@@ -54,7 +53,6 @@ export declare class ImportDefaultSpecifier extends ModuleSpecifier {
|
|
|
54
53
|
export declare class ImportNamespaceSpecifier extends ModuleSpecifier {
|
|
55
54
|
static fromJSON(node: ImportNamespaceSpecifier, deserializer: NodeDeserializer): ImportNamespaceSpecifier;
|
|
56
55
|
static visit(node: ImportNamespaceSpecifier, visitNode: VisitNodeType): void;
|
|
57
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
58
56
|
set(stack: Stack, value: any): void;
|
|
59
57
|
get(stack: Stack, thisContext?: any): void;
|
|
60
58
|
dependency(computed?: true): ExpressionNode[];
|
|
@@ -95,7 +93,6 @@ export declare class ImportDeclaration extends AbstractExpressionNode {
|
|
|
95
93
|
getSource(): Literal<string>;
|
|
96
94
|
getSpecifiers(): (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[] | undefined;
|
|
97
95
|
getAssertions(): ImportAttribute[] | undefined;
|
|
98
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
99
96
|
set(stack: Stack): void;
|
|
100
97
|
get(stack: Stack): void;
|
|
101
98
|
dependency(computed?: true): ExpressionNode[];
|
|
@@ -116,7 +113,6 @@ export declare class ImportExpression extends AbstractExpressionNode {
|
|
|
116
113
|
static visit(node: ImportExpression, visitNode: VisitNodeType): void;
|
|
117
114
|
constructor(source: Literal<string>, attributes?: ExpressionNode | undefined);
|
|
118
115
|
getSource(): Literal<string>;
|
|
119
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
120
116
|
set(stack: Stack): void;
|
|
121
117
|
get(stack: Stack): Promise<ModuleScope>;
|
|
122
118
|
dependency(computed?: true): ExpressionNode[];
|
package/api/module/import.js
CHANGED
|
@@ -36,7 +36,8 @@ let ImportSpecifier = ImportSpecifier_1 = class ImportSpecifier extends ModuleSp
|
|
|
36
36
|
getImported() {
|
|
37
37
|
return this.imported;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
getImportedName() {
|
|
40
|
+
return this.imported.getName();
|
|
40
41
|
}
|
|
41
42
|
set(stack, value) {
|
|
42
43
|
throw new Error('Method not implemented.');
|
|
@@ -80,8 +81,6 @@ let ImportDefaultSpecifier = ImportDefaultSpecifier_1 = class ImportDefaultSpeci
|
|
|
80
81
|
static visit(node, visitNode) {
|
|
81
82
|
visitNode(node.local);
|
|
82
83
|
}
|
|
83
|
-
shareVariables(scopeList) {
|
|
84
|
-
}
|
|
85
84
|
set(stack, value) {
|
|
86
85
|
throw new Error('Method not implemented.');
|
|
87
86
|
}
|
|
@@ -112,8 +111,6 @@ let ImportNamespaceSpecifier = ImportNamespaceSpecifier_1 = class ImportNamespac
|
|
|
112
111
|
static visit(node, visitNode) {
|
|
113
112
|
visitNode(node.local);
|
|
114
113
|
}
|
|
115
|
-
shareVariables(scopeList) {
|
|
116
|
-
}
|
|
117
114
|
set(stack, value) {
|
|
118
115
|
throw new Error('Method not implemented.');
|
|
119
116
|
}
|
|
@@ -182,7 +179,6 @@ let ImportDeclaration = ImportDeclaration_1 = class ImportDeclaration extends Ab
|
|
|
182
179
|
getAssertions() {
|
|
183
180
|
return this.assertions;
|
|
184
181
|
}
|
|
185
|
-
shareVariables(scopeList) { }
|
|
186
182
|
set(stack) {
|
|
187
183
|
throw new Error(`ImportDeclaration.#set() has no implementation.`);
|
|
188
184
|
}
|
|
@@ -201,9 +197,9 @@ let ImportDeclaration = ImportDeclaration_1 = class ImportDeclaration extends Ab
|
|
|
201
197
|
return;
|
|
202
198
|
}
|
|
203
199
|
this.specifiers.forEach(specifier => {
|
|
204
|
-
const local = specifier.
|
|
200
|
+
const local = specifier.getLocalName();
|
|
205
201
|
if (specifier instanceof ImportSpecifier) {
|
|
206
|
-
const imported = specifier.
|
|
202
|
+
const imported = specifier.getImportedName();
|
|
207
203
|
const importedValue = module.get(imported);
|
|
208
204
|
stack.getModule()?.set(local, importedValue);
|
|
209
205
|
const scopeSubscription = module.subscribe(local, (newValue, oldValue) => {
|
|
@@ -289,7 +285,6 @@ let ImportExpression = ImportExpression_1 = class ImportExpression extends Abstr
|
|
|
289
285
|
getSource() {
|
|
290
286
|
return this.source;
|
|
291
287
|
}
|
|
292
|
-
shareVariables(scopeList) { }
|
|
293
288
|
set(stack) {
|
|
294
289
|
throw new Error(`ImportDeclaration.#set() has no implementation.`);
|
|
295
290
|
}
|
package/api/module/import.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/import.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAmB,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,eAAe;IAWnD,YAAY,KAAiB,EAAU,QAAoB;QAC1D,KAAK,CAAC,KAAK,CAAC,CAAC;QADyB,aAAQ,GAAR,QAAQ,CAAY;IAE3D,CAAC;IAZD,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,YAA8B;QACpE,OAAO,IAAI,iBAAe,CACzB,YAAY,CAAC,IAAI,CAAC,KAAK,CAAe,EACtC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAe,CACzC,CAAC;IACH,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB;QAC3D,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAID,WAAW;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,cAAc,CAAC,SAAuB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AAK,CAAC,CAAC;SAC/C;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,iBAAiB,CAAC,CAAC;QACxE,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,UAAU,CAAC,QAAe;QACzB,OAAO,EAAE,CAAC;IACX,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,QAAQ;QACP,OAAO,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACvG,CAAC;IACD,MAAM;QACL,OAAO;YACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;SAC5B,CAAC;IACH,CAAC;CACD,CAAA;AA3CY,gBAAgB;IAD5B,YAAY,CAAC,kBAAkB,CAAC;qCAYJ,OAAO;GAXvB,gBAAgB,CA2C5B;SA3CY,gBAAgB","sourcesContent":["import type {\n\tNodeDeserializer, ExpressionNode,\n\tExpressionEventPath, VisitNodeType,\n} from '../expression.js';\nimport type { ModuleScope, Scope } from '../../scope/scope.js';\nimport type { 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';\n\n/**\n * An imported variable binding,\n * \n * e.g., {foo} in import {foo} from \"mod\"\n * or {foo as bar} in import {foo as bar} from \"mod\".\n * \n * The imported field refers to the name of the export imported from the module.\n * \n * The local field refers to the binding imported into the local module scope.\n * \n * If it is a basic named import, such as in import {foo} from \"mod\",\n * both imported and local are equivalent Identifier nodes; in this case an Identifier node representing foo.\n * \n * If it is an aliased import, such as in import {foo as bar} from \"mod\",\n * the imported field is an Identifier node representing foo,\n * and the local field is an Identifier node representing bar.\n */\n@Deserializer('ImportSpecifier')\nexport class ImportSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ImportSpecifier, deserializer: NodeDeserializer): ImportSpecifier {\n\t\treturn new ImportSpecifier(\n\t\t\tdeserializer(node.local) as Identifier,\n\t\t\tdeserializer(node.imported) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ImportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.imported);\n\t}\n\tconstructor(local: Identifier, private imported: Identifier) {\n\t\tsuper(local);\n\t}\n\tgetImported() {\n\t\treturn this.imported;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void {\n\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 imported = this.imported.toString();\n\t\tif (local == imported) {\n\t\t\treturn local;\n\t\t}\n\t\treturn `${imported} as ${local}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON(),\n\t\t\timported: this.imported.toJSON()\n\t\t};\n\t}\n}\n\n/**\n * A default import specifier, e.g., `foo` in `import foo from \"mod.js\";`.\n */\n@Deserializer('ImportDefaultSpecifier')\nexport class ImportDefaultSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ImportDefaultSpecifier, deserializer: NodeDeserializer): ImportDefaultSpecifier {\n\t\treturn new ImportDefaultSpecifier(\n\t\t\tdeserializer(node.local) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ImportDefaultSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void {\n\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\treturn this.local.toString();\n\t}\n}\n\n/**\n * A namespace import specifier, e.g., `* as foo` in `import * as foo from \"mod.js\";`.\n */\n@Deserializer('ImportNamespaceSpecifier')\nexport class ImportNamespaceSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ImportNamespaceSpecifier, deserializer: NodeDeserializer): ImportNamespaceSpecifier {\n\t\treturn new ImportNamespaceSpecifier(\n\t\t\tdeserializer(node.local) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ImportNamespaceSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void {\n\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\treturn `* as ${this.local.toString()}`;\n\t}\n}\n\n/**\n * An import declaration, e.g., import foo from \"mod\";.\n * \n * import defaultExport from \"module-name\";\n * \n * import * as name from \"module-name\";\n * \n * import { export1 } from \"module-name\";\n * \n * import { export1 as alias1 } from \"module-name\";\n * \n * import { export1 , export2 } from \"module-name\";\n * \n * import { foo , bar } from \"module-name/path/to/specific/un-exported/file\";\n * \n * import { export1 , export2 as alias2 , [...] } from \"module-name\";\n * \n * import defaultExport, { export1 [ , [...] ] } from \"module-name\";\n * \n * import defaultExport, * as name from \"module-name\";\n * \n * import \"module-name\";\n * \n */\n@Deserializer('ImportDeclaration')\nexport class ImportDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportDeclaration, deserializer: NodeDeserializer): ImportDeclaration {\n\t\treturn new ImportDeclaration(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\tnode.specifiers?.map(deserializer) as (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[],\n\t\t\tnode.assertions?.map(deserializer) as (ImportAttribute)[],\n\t\t);\n\t}\n\tstatic visit(node: ImportDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.specifiers?.forEach(visitNode);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate source: Literal<string>,\n\t\tprivate specifiers?: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[],\n\t\tprivate assertions?: ImportAttribute[]) {\n\t\tsuper();\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetSpecifiers() {\n\t\treturn this.specifiers;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ImportDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack): void {\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 module = stack.importModule(this.source.get(), importCallOptions);\n\t\tif (!this.specifiers) {\n\t\t\treturn;\n\t\t}\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst local = specifier.getLocal().get(stack);\n\t\t\tif (specifier instanceof ImportSpecifier) {\n\t\t\t\tconst imported = specifier.getImported().get(stack);\n\t\t\t\tconst importedValue = module.get(imported);\n\t\t\t\tstack.getModule()?.set(local, importedValue);\n\t\t\t\tconst scopeSubscription = module.subscribe(local, (newValue, oldValue) => {\n\t\t\t\t\tif (newValue !== oldValue) {\n\t\t\t\t\t\tstack.getModule()?.set(local, newValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t} else if (specifier instanceof ImportDefaultSpecifier) {\n\t\t\t\tconst defaultValue = module.get('default');\n\t\t\t\tstack.getModule()?.set(local, defaultValue);\n\t\t\t\tconst scopeSubscription = module.subscribe('default', (newValue, oldValue) => {\n\t\t\t\t\tif (newValue !== oldValue) {\n\t\t\t\t\t\tstack.getModule()?.set(local, newValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t} else if (specifier instanceof ImportNamespaceSpecifier) {\n\t\t\t\tstack.getModule()?.importModule(local, module);\n\t\t\t}\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(): string {\n\t\tif (!this.specifiers) {\n\t\t\treturn `import '${this.source.toString()}'`;\n\t\t}\n\t\tconst parts: string[] = [];\n\t\tconst importDefaultSpecifiers = this.specifiers.filter(specifier => specifier instanceof ImportDefaultSpecifier) as ImportDefaultSpecifier[];\n\t\tif (importDefaultSpecifiers?.length) {\n\t\t\tparts.push(importDefaultSpecifiers[0].toString());\n\t\t}\n\t\tconst importNamespaceSpecifiers = this.specifiers.filter(specifier => specifier instanceof ImportNamespaceSpecifier) as ImportNamespaceSpecifier[];\n\t\tif (importNamespaceSpecifiers?.length) {\n\t\t\tparts.push(importNamespaceSpecifiers[0].toString());\n\t\t}\n\t\tconst importSpecifiers = this.specifiers.filter(specifier => specifier instanceof ImportSpecifier) as ImportSpecifier[];\n\t\tif (importSpecifiers?.length) {\n\t\t\tconst importSpecifiersString = importSpecifiers.map(importSpecifier => importSpecifier.toString()).join(',');\n\t\t\tparts.push(`{ ${importSpecifiersString} }`);\n\t\t}\n\t\treturn `import ${parts.join(', ')} 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\tspecifiers: this.specifiers?.map(specifier => specifier.toJSON()),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n\n\n/**\n * `ImportExpression` node represents Dynamic Imports such as `import(source)`.\n * The `source` property is the importing source as similar to ImportDeclaration node,\n * but it can be an arbitrary expression node.\n * var promise = import(\"module-name\");\n */\n@Deserializer('ImportExpression')\nexport class ImportExpression extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportExpression, deserializer: NodeDeserializer): ImportExpression {\n\t\treturn new ImportExpression(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\t(node.attributes && deserializer(node.attributes)) || undefined\n\t\t);\n\t}\n\tstatic visit(node: ImportExpression, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.attributes && visitNode(node.attributes);\n\t}\n\tconstructor(private source: Literal<string>, private attributes?: ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack) {\n\t\tthrow new Error(`ImportDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack): Promise<ModuleScope> {\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.attributes) {\n\t\t\timportCallOptions = this.attributes.get(stack);\n\t\t}\n\t\tconst module = stack.importModule(this.source.get(), importCallOptions);\n\t\treturn Promise.resolve(module);\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 `import(${this.source.toString()}${this.attributes ? `, ${this.attributes.toString()}` : ''})`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tsource: this.source.toJSON(),\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/import.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAmB,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,eAAe;IAWnD,YAAY,KAAiB,EAAU,QAAoB;QAC1D,KAAK,CAAC,KAAK,CAAC,CAAC;QADyB,aAAQ,GAAR,QAAQ,CAAY;IAE3D,CAAC;IAZD,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,YAA8B;QACpE,OAAO,IAAI,iBAAe,CACzB,YAAY,CAAC,IAAI,CAAC,KAAK,CAAe,EACtC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAe,CACzC,CAAC;IACH,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB;QAC3D,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtB,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAID,WAAW;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,eAAe;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;IACD,GAA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,EAAE,CAAC;IACX,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,QAAQ;QACP,OAAO,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACvG,CAAC;IACD,MAAM;QACL,OAAO;YACN,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;SAC5B,CAAC;IACH,CAAC;CACD,CAAA;AA1CY,gBAAgB;IAD5B,YAAY,CAAC,kBAAkB,CAAC;qCAYJ,OAAO;GAXvB,gBAAgB,CA0C5B;SA1CY,gBAAgB","sourcesContent":["import type {\n\tNodeDeserializer, ExpressionNode,\n\tExpressionEventPath, VisitNodeType,\n} from '../expression.js';\nimport type { ModuleScope } from '../../scope/scope.js';\nimport type { 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';\n\n/**\n * An imported variable binding,\n * \n * e.g., {foo} in import {foo} from \"mod\"\n * or {foo as bar} in import {foo as bar} from \"mod\".\n * \n * The imported field refers to the name of the export imported from the module.\n * \n * The local field refers to the binding imported into the local module scope.\n * \n * If it is a basic named import, such as in import {foo} from \"mod\",\n * both imported and local are equivalent Identifier nodes; in this case an Identifier node representing foo.\n * \n * If it is an aliased import, such as in import {foo as bar} from \"mod\",\n * the imported field is an Identifier node representing foo,\n * and the local field is an Identifier node representing bar.\n */\n@Deserializer('ImportSpecifier')\nexport class ImportSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ImportSpecifier, deserializer: NodeDeserializer): ImportSpecifier {\n\t\treturn new ImportSpecifier(\n\t\t\tdeserializer(node.local) as Identifier,\n\t\t\tdeserializer(node.imported) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ImportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.imported);\n\t}\n\tconstructor(local: Identifier, private imported: Identifier) {\n\t\tsuper(local);\n\t}\n\tgetImported() {\n\t\treturn this.imported;\n\t}\n\tgetImportedName() {\n\t\treturn this.imported.getName();\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 imported = this.imported.toString();\n\t\tif (local == imported) {\n\t\t\treturn local;\n\t\t}\n\t\treturn `${imported} as ${local}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON(),\n\t\t\timported: this.imported.toJSON()\n\t\t};\n\t}\n}\n\n/**\n * A default import specifier, e.g., `foo` in `import foo from \"mod.js\";`.\n */\n@Deserializer('ImportDefaultSpecifier')\nexport class ImportDefaultSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ImportDefaultSpecifier, deserializer: NodeDeserializer): ImportDefaultSpecifier {\n\t\treturn new ImportDefaultSpecifier(\n\t\t\tdeserializer(node.local) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ImportDefaultSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\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\treturn this.local.toString();\n\t}\n}\n\n/**\n * A namespace import specifier, e.g., `* as foo` in `import * as foo from \"mod.js\";`.\n */\n@Deserializer('ImportNamespaceSpecifier')\nexport class ImportNamespaceSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ImportNamespaceSpecifier, deserializer: NodeDeserializer): ImportNamespaceSpecifier {\n\t\treturn new ImportNamespaceSpecifier(\n\t\t\tdeserializer(node.local) as Identifier\n\t\t);\n\t}\n\tstatic visit(node: ImportNamespaceSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\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\treturn `* as ${this.local.toString()}`;\n\t}\n}\n\n/**\n * An import declaration, e.g., import foo from \"mod\";.\n * \n * import defaultExport from \"module-name\";\n * \n * import * as name from \"module-name\";\n * \n * import { export1 } from \"module-name\";\n * \n * import { export1 as alias1 } from \"module-name\";\n * \n * import { export1 , export2 } from \"module-name\";\n * \n * import { foo , bar } from \"module-name/path/to/specific/un-exported/file\";\n * \n * import { export1 , export2 as alias2 , [...] } from \"module-name\";\n * \n * import defaultExport, { export1 [ , [...] ] } from \"module-name\";\n * \n * import defaultExport, * as name from \"module-name\";\n * \n * import \"module-name\";\n * \n */\n@Deserializer('ImportDeclaration')\nexport class ImportDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportDeclaration, deserializer: NodeDeserializer): ImportDeclaration {\n\t\treturn new ImportDeclaration(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\tnode.specifiers?.map(deserializer) as (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[],\n\t\t\tnode.assertions?.map(deserializer) as (ImportAttribute)[],\n\t\t);\n\t}\n\tstatic visit(node: ImportDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.specifiers?.forEach(visitNode);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate source: Literal<string>,\n\t\tprivate specifiers?: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[],\n\t\tprivate assertions?: ImportAttribute[]) {\n\t\tsuper();\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetSpecifiers() {\n\t\treturn this.specifiers;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ImportDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack): void {\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 module = stack.importModule(this.source.get(), importCallOptions);\n\t\tif (!this.specifiers) {\n\t\t\treturn;\n\t\t}\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst local = specifier.getLocalName();\n\t\t\tif (specifier instanceof ImportSpecifier) {\n\t\t\t\tconst imported = specifier.getImportedName();\n\t\t\t\tconst importedValue = module.get(imported);\n\t\t\t\tstack.getModule()?.set(local, importedValue);\n\t\t\t\tconst scopeSubscription = module.subscribe(local, (newValue, oldValue) => {\n\t\t\t\t\tif (newValue !== oldValue) {\n\t\t\t\t\t\tstack.getModule()?.set(local, newValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t} else if (specifier instanceof ImportDefaultSpecifier) {\n\t\t\t\tconst defaultValue = module.get('default');\n\t\t\t\tstack.getModule()?.set(local, defaultValue);\n\t\t\t\tconst scopeSubscription = module.subscribe('default', (newValue, oldValue) => {\n\t\t\t\t\tif (newValue !== oldValue) {\n\t\t\t\t\t\tstack.getModule()?.set(local, newValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t} else if (specifier instanceof ImportNamespaceSpecifier) {\n\t\t\t\tstack.getModule()?.importModule(local, module);\n\t\t\t}\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(): string {\n\t\tif (!this.specifiers) {\n\t\t\treturn `import '${this.source.toString()}'`;\n\t\t}\n\t\tconst parts: string[] = [];\n\t\tconst importDefaultSpecifiers = this.specifiers.filter(specifier => specifier instanceof ImportDefaultSpecifier) as ImportDefaultSpecifier[];\n\t\tif (importDefaultSpecifiers?.length) {\n\t\t\tparts.push(importDefaultSpecifiers[0].toString());\n\t\t}\n\t\tconst importNamespaceSpecifiers = this.specifiers.filter(specifier => specifier instanceof ImportNamespaceSpecifier) as ImportNamespaceSpecifier[];\n\t\tif (importNamespaceSpecifiers?.length) {\n\t\t\tparts.push(importNamespaceSpecifiers[0].toString());\n\t\t}\n\t\tconst importSpecifiers = this.specifiers.filter(specifier => specifier instanceof ImportSpecifier) as ImportSpecifier[];\n\t\tif (importSpecifiers?.length) {\n\t\t\tconst importSpecifiersString = importSpecifiers.map(importSpecifier => importSpecifier.toString()).join(',');\n\t\t\tparts.push(`{ ${importSpecifiersString} }`);\n\t\t}\n\t\treturn `import ${parts.join(', ')} 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\tspecifiers: this.specifiers?.map(specifier => specifier.toJSON()),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n\n\n/**\n * `ImportExpression` node represents Dynamic Imports such as `import(source)`.\n * The `source` property is the importing source as similar to ImportDeclaration node,\n * but it can be an arbitrary expression node.\n * var promise = import(\"module-name\");\n */\n@Deserializer('ImportExpression')\nexport class ImportExpression extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportExpression, deserializer: NodeDeserializer): ImportExpression {\n\t\treturn new ImportExpression(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\t(node.attributes && deserializer(node.attributes)) || undefined\n\t\t);\n\t}\n\tstatic visit(node: ImportExpression, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.attributes && visitNode(node.attributes);\n\t}\n\tconstructor(private source: Literal<string>, private attributes?: ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ImportDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack): Promise<ModuleScope> {\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.attributes) {\n\t\t\timportCallOptions = this.attributes.get(stack);\n\t\t}\n\t\tconst module = stack.importModule(this.source.get(), importCallOptions);\n\t\treturn Promise.resolve(module);\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 `import(${this.source.toString()}${this.attributes ? `, ${this.attributes.toString()}` : ''})`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tsource: this.source.toJSON(),\n\t\t};\n\t}\n}\n"]}
|
package/api/operators/await.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType } from '../expression.js';
|
|
2
|
-
import type { Scope } from '../../scope/scope.js';
|
|
3
2
|
import type { Stack } from '../../scope/stack.js';
|
|
4
3
|
import { AbstractExpressionNode, AwaitPromise } from '../abstract.js';
|
|
5
4
|
export declare class AwaitExpression extends AbstractExpressionNode {
|
|
@@ -8,7 +7,6 @@ export declare class AwaitExpression extends AbstractExpressionNode {
|
|
|
8
7
|
static visit(node: AwaitExpression, visitNode: VisitNodeType): void;
|
|
9
8
|
constructor(argument: ExpressionNode);
|
|
10
9
|
getArgument(): ExpressionNode;
|
|
11
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
12
10
|
set(stack: Stack, value: any): void;
|
|
13
11
|
get(stack: Stack, thisContext?: any): AwaitPromise;
|
|
14
12
|
dependency(computed?: true): ExpressionNode[];
|
package/api/operators/await.js
CHANGED
|
@@ -16,9 +16,6 @@ let AwaitExpression = AwaitExpression_1 = class AwaitExpression extends Abstract
|
|
|
16
16
|
getArgument() {
|
|
17
17
|
return this.argument;
|
|
18
18
|
}
|
|
19
|
-
shareVariables(scopeList) {
|
|
20
|
-
this.argument.shareVariables(scopeList);
|
|
21
|
-
}
|
|
22
19
|
set(stack, value) {
|
|
23
20
|
throw new Error('AwaitExpression#set() has no implementation.');
|
|
24
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"await.js","sourceRoot":"","sources":["../../../../src/expressions/api/operators/await.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"await.js","sourceRoot":"","sources":["../../../../src/expressions/api/operators/await.ts"],"names":[],"mappings":";;AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI/D,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,sBAAsB;IAO1D,YAAoB,QAAwB;QAC3C,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAgB;IAE5C,CAAC;IARD,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,UAA4B;QAClE,OAAO,IAAI,iBAAe,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB;QAC3D,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAID,WAAW;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,KAAU;QAC3B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IACjE,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,WAAiB;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IACD,UAAU,CAAC,QAAe;QACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACD,QAAQ;QACP,OAAO,SAAS,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC5C,CAAC;IACD,MAAM;QACL,OAAO;YACN,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;SAChC,CAAC;IACH,CAAC;CACD,CAAA;AAlCY,eAAe;IAD3B,YAAY,CAAC,iBAAiB,CAAC;;GACnB,eAAe,CAkC3B;SAlCY,eAAe","sourcesContent":["import type {\n\tNodeDeserializer, ExpressionNode,\n\tExpressionEventPath, VisitNodeType\n} from '../expression.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode, AwaitPromise } from '../abstract.js';\n\n\n@Deserializer('AwaitExpression')\nexport class AwaitExpression extends AbstractExpressionNode {\n\tstatic fromJSON(node: AwaitExpression, serializer: NodeDeserializer): AwaitExpression {\n\t\treturn new AwaitExpression(serializer(node.argument));\n\t}\n\tstatic visit(node: AwaitExpression, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.argument);\n\t}\n\tconstructor(private argument: ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetArgument() {\n\t\treturn this.argument;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('AwaitExpression#set() has no implementation.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tconst promise = this.argument.get(stack);\n\t\treturn new AwaitPromise(promise);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.argument.dependency(computed);\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.argument.dependencyPath(computed);\n\t}\n\ttoString() {\n\t\treturn `await ${this.argument.toString()}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\targument: this.argument.toJSON()\n\t\t};\n\t}\n}\n"]}
|
|
@@ -8,7 +8,6 @@ export declare class ChainExpression extends AbstractExpressionNode implements C
|
|
|
8
8
|
static visit(node: ChainExpression, visitNode: VisitNodeType): void;
|
|
9
9
|
constructor(expression: ExpressionNode);
|
|
10
10
|
getExpression(): ExpressionNode;
|
|
11
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
12
11
|
set(stack: Stack, value: any): void;
|
|
13
12
|
get(stack: Stack, thisContext?: any): any;
|
|
14
13
|
findScope<T extends object>(stack: Stack): Scope<T>;
|
|
@@ -16,7 +16,6 @@ let ChainExpression = ChainExpression_1 = class ChainExpression extends Abstract
|
|
|
16
16
|
getExpression() {
|
|
17
17
|
return this.expression;
|
|
18
18
|
}
|
|
19
|
-
shareVariables(scopeList) { }
|
|
20
19
|
set(stack, value) {
|
|
21
20
|
throw new Error(`ChainExpression.#set() has no implementation.`);
|
|
22
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chaining.js","sourceRoot":"","sources":["../../../../src/expressions/api/operators/chaining.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGtD,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,sBAAsB;IAO1D,YAAoB,UAA0B;QAC7C,KAAK,EAAE,CAAC;QADW,eAAU,GAAV,UAAU,CAAgB;IAE9C,CAAC;IARD,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,YAA8B;QACpE,OAAO,IAAI,iBAAe,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB;QAC3D,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAID,aAAa;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,
|
|
1
|
+
{"version":3,"file":"chaining.js","sourceRoot":"","sources":["../../../../src/expressions/api/operators/chaining.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGtD,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,sBAAsB;IAO1D,YAAoB,UAA0B;QAC7C,KAAK,EAAE,CAAC;QADW,eAAU,GAAV,UAAU,CAAgB;IAE9C,CAAC;IARD,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,YAA8B;QACpE,OAAO,IAAI,iBAAe,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB;QAC3D,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;IAID,aAAa;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,KAAU;QAC3B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IACjE,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,WAAiB;QAClC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;IAGD,SAAS,CAAmB,KAAY,EAAE,WAAwB;QACjE,OAAQ,IAAI,CAAC,UAA4C,CAAC,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACzF,CAAC;IACD,UAAU,CAAC,QAAe;QACzB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,cAAc,CAAC,QAAe;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;IACD,QAAQ;QACP,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;IACD,MAAM;QACL,OAAO;YACN,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;SACpC,CAAC;IACH,CAAC;CACD,CAAA;AAtCY,eAAe;IAD3B,YAAY,CAAC,iBAAiB,CAAC;;GACnB,eAAe,CAsC3B;SAtCY,eAAe","sourcesContent":["import type {\n\tNodeDeserializer, ExpressionNode, CanFindScope,\n\tExpressionEventPath, VisitNodeType\n} from '../expression.js';\nimport type { Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\n@Deserializer('ChainExpression')\nexport class ChainExpression extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: ChainExpression, deserializer: NodeDeserializer): ChainExpression {\n\t\treturn new ChainExpression(deserializer(node.expression));\n\t}\n\tstatic visit(node: ChainExpression, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.expression);\n\t}\n\tconstructor(private expression: ExpressionNode) {\n\t\tsuper();\n\t}\n\tgetExpression() {\n\t\treturn this.expression;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`ChainExpression.#set() has no implementation.`)\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\treturn this.expression.get(stack, thisContext);\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, objectScope?: Scope<any>): Scope<T> | undefined {\n\t\treturn (this.expression as ExpressionNode & CanFindScope).findScope(stack, objectScope);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expression.dependency(computed);\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expression.dependencyPath(computed);\n\t}\n\ttoString() {\n\t\treturn this.expression.toString();\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\texpression: this.expression.toJSON(),\n\t\t};\n\t}\n}\n"]}
|
package/api/operators/comma.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType } from '../expression.js';
|
|
2
|
-
import type { Scope } from '../../scope/scope.js';
|
|
3
2
|
import type { Stack } from '../../scope/stack.js';
|
|
4
3
|
import { AbstractExpressionNode } from '../abstract.js';
|
|
5
4
|
export declare class SequenceExpression extends AbstractExpressionNode {
|
|
@@ -8,7 +7,6 @@ export declare class SequenceExpression extends AbstractExpressionNode {
|
|
|
8
7
|
static visit(node: SequenceExpression, visitNode: VisitNodeType): void;
|
|
9
8
|
constructor(expressions: ExpressionNode[]);
|
|
10
9
|
getExpressions(): ExpressionNode[];
|
|
11
|
-
shareVariables(scopeList: Scope<any>[]): void;
|
|
12
10
|
set(stack: Stack): void;
|
|
13
11
|
get(stack: Stack): any;
|
|
14
12
|
dependency(computed?: true): ExpressionNode[];
|
package/api/operators/comma.js
CHANGED
|
@@ -16,9 +16,6 @@ let SequenceExpression = SequenceExpression_1 = class SequenceExpression extends
|
|
|
16
16
|
getExpressions() {
|
|
17
17
|
return this.expressions;
|
|
18
18
|
}
|
|
19
|
-
shareVariables(scopeList) {
|
|
20
|
-
this.expressions.forEach(statement => statement.shareVariables(scopeList));
|
|
21
|
-
}
|
|
22
19
|
set(stack) {
|
|
23
20
|
throw new Error(`SequenceExpression.#set() has no implementation.`);
|
|
24
21
|
}
|