@ibyar/expressions 0.6.1 → 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/README.md +7 -2
- 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 +232 -169
- 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 +6 -9
- package/api/definition/values.js +9 -20
- 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/assignment.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/binary.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/logical.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 +3 -3
- 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/enums.d.ts +0 -7
- package/v8/enums.js +0 -15
- package/v8/enums.js.map +1 -1
- package/v8/index.d.ts +1 -0
- package/v8/index.js +1 -0
- package/v8/index.js.map +1 -1
- package/v8/inline.d.ts +5 -2
- package/v8/inline.js +31 -17
- package/v8/inline.js.map +1 -1
- package/v8/language.d.ts +7 -0
- package/v8/language.js +16 -0
- package/v8/language.js.map +1 -0
- package/v8/nodes.d.ts +1 -1
- package/v8/parser.d.ts +2 -1
- package/v8/parser.js +2 -1
- package/v8/parser.js.map +1 -1
- package/v8/stream.d.ts +1 -1
- package/v8/stream.js +1 -1
- package/v8/stream.js.map +1 -1
- package/v8/token.d.ts +1 -1
- package/v8/token.js +1 -1
- package/v8/token.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/expressions/api/definition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AAK,CAAC,CAAe,CAAC;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAe,CAAC;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAe,CAAC;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,aAAa,CAAC,CAAe,CAAC;AAChG,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAe,CAAC;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAe,CAAC;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAe,CAAC;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAe,CAAC;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAe,CAAC;AACpF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAe,CAAC","sourcesContent":["import type {\n\tDeclarationExpression, ExpressionNode, NodeDeserializer,\n\tCanFindScope, ExpressionEventPath, VisitNodeType\n} from '../expression.js';\nimport type { Context, Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode } from '../abstract.js';\n\n/**\n * An identifier is a sequence of characters in the code that identifies a variable, function, or property.\n * In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9),\n * but may not start with a digit.\n * An identifier differs from a string in that a string is data,\n * while an identifier is part of the code. In JavaScript,\n * there is no way to convert identifiers to strings,\n * but sometimes it is possible to parse strings into identifiers.\n */\n@Deserializer('Identifier')\nexport class Identifier extends AbstractExpressionNode implements DeclarationExpression, CanFindScope {\n\tstatic fromJSON(node: Identifier): Identifier {\n\t\treturn new Identifier(node.name);\n\t}\n\tconstructor(protected name: string | number) {\n\t\tsuper();\n\t}\n\tgetName() {\n\t\treturn this.name;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset(stack: Stack, value: any) {\n\t\treturn stack.set(this.name, value) ? value : void 0;\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tif (thisContext) {\n\t\t\treturn thisContext[this.name];\n\t\t}\n\t\treturn stack.get(this.name);\n\t}\n\tfindScope<T extends object>(stack: Stack): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope: Scope<any>): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope?: Scope<any>): Scope<T> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.name);\n\t\t}\n\t\tscope = stack.findScope(this.name);\n\t\treturn scope.getInnerScope(this.name);\n\t}\n\tdeclareVariable(stack: Stack, propertyValue: any): any {\n\t\treturn stack.declareVariable(this.name, propertyValue);\n\t}\n\tgetDeclarationName(): string {\n\t\treturn this.toString();\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [this];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tconst path: ExpressionEventPath[] = [{ computed: false, path: this.toString() }];\n\t\treturn computed ? [{ computed, path: this.toString(), computedPath: [path] }] : path;\n\t}\n\ttoString(): string {\n\t\treturn String(this.name);\n\t}\n\ttoJson(): object {\n\t\treturn { name: this.name };\n\t}\n}\n\n@Deserializer('ThisExpression')\nexport class ThisExpression extends Identifier {\n\tstatic fromJSON(node: ThisExpression): ThisExpression {\n\t\treturn ThisNode;\n\t}\n\tconstructor() {\n\t\tsuper('this');\n\t}\n}\n\n@Deserializer('Literal')\nexport class Literal<T> extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: Literal<any>):\n\t\tLiteral<string>\n\t\t| Literal<number>\n\t\t| Literal<boolean>\n\t\t| Literal<RegExp>\n\t\t| Literal<bigint>\n\t\t| Literal<null>\n\t\t| Literal<undefined> {\n\t\tif (node.bigint) {\n\t\t\treturn new Literal(BigInt(node.bigint), node.raw, undefined, node.bigint);\n\t\t} else if (node.regex) {\n\t\t\treturn new Literal(RegExp(node.regex.pattern, node.regex.flags), node.raw, node.regex);\n\t\t}\n\t\treturn new Literal(node.value, node.raw);\n\t}\n\tconstructor(protected value: T, protected raw?: string, protected regex?: { pattern: string, flags: string }, protected bigint?: string) {\n\t\tsuper();\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tgetRegex() {\n\t\treturn this.regex;\n\t}\n\tgetBigint() {\n\t\treturn this.bigint;\n\t}\n\tgeRaw() {\n\t\treturn this.raw;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void { }\n\tset() {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(): T {\n\t\treturn this.value;\n\t}\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.value as any);\n\t\t}\n\t\tscope = stack.findScope(this.value as any);\n\t\treturn scope.getInnerScope(this.value as any);\n\t}\n\tdependency(computed: true): ExpressionNode[] {\n\t\treturn computed ? [this] : [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn computed ? [{ computed: false, path: this.toString() }] : [];\n\t}\n\ttoString(): string {\n\t\treturn this.raw ?? String(this.value);\n\t}\n\ttoJson(): object {\n\t\tif (this.bigint) {\n\t\t\treturn {\n\t\t\t\tbigint: this.bigint,\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t} else if (this.regex) {\n\t\t\treturn {\n\t\t\t\tregex: { pattern: this.regex?.pattern, flags: this.regex?.flags },\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalue: this.value,\n\t\t\traw: this.raw,\n\t\t};\n\t}\n}\n\nclass TemplateArray extends Array<string> implements TemplateStringsArray {\n\traw: readonly string[];\n\tconstructor(strings: string[]) {\n\t\tsuper(...strings);\n\t\tthis.raw = strings;\n\t}\n}\n\nexport class TemplateLiteralExpressionNode extends AbstractExpressionNode {\n\tstatic fromJSON(node: TemplateLiteralExpressionNode, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TemplateLiteralExpressionNode(\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.tag ? deserializer(node.tag) : void 0\n\t\t);\n\t}\n\tstatic visit(node: TemplateLiteralExpressionNode, visitNode: VisitNodeType): void {\n\t\tnode.tag && visitNode(node.tag);\n\t\tnode.expressions.forEach(visitNode);\n\t}\n\tconstructor(protected quasis: string[], protected expressions: ExpressionNode[], protected tag?: ExpressionNode,) {\n\t\tsuper();\n\t}\n\tgetTag() {\n\t\treturn this.tag;\n\t}\n\tgetExpressions() {\n\t\treturn this.expressions;\n\t}\n\tshareVariables(scopeList: Scope<any>[]): void {\n\t\tthis.expressions.forEach(value => value.shareVariables(scopeList));\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`TemplateLiteralExpressionNode#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst tagged: Function = this.tag?.get(stack) || String.raw;\n\t\tconst templateStringsArray = new TemplateArray(this.quasis);\n\t\ttemplateStringsArray.raw = templateStringsArray;\n\t\tconst values = this.expressions.map(expr => expr.get(stack));\n\t\treturn tagged(templateStringsArray, ...values);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tlet str = this.tag?.toString() || '';\n\t\tstr += '`';\n\t\tlet i = 0;\n\t\tfor (; i < this.quasis.length - 1; i++) {\n\t\t\tstr += this.quasis[i];\n\t\t\tstr += '${';\n\t\t\tstr += this.expressions[i].toString();\n\t\t\tstr += '}';\n\t\t}\n\t\tstr += this.quasis[i];\n\t\tstr += '`';\n\t\treturn str;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tquasis: this.quasis,\n\t\t\texpressions: this.expressions.map(expr => expr.toJSON()),\n\t\t\ttag: this.tag?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('TemplateLiteral')\nexport class TemplateLiteral extends TemplateLiteralExpressionNode {\n\tdeclare protected tag: undefined;\n\tconstructor(quasis: string[], expressions: ExpressionNode[]) {\n\t\tsuper(quasis, expressions);\n\t}\n\toverride getTag(): undefined {\n\t\treturn undefined;\n\t}\n}\n\n@Deserializer('TaggedTemplateExpression')\nexport class TaggedTemplateExpression extends TemplateLiteralExpressionNode {\n\tdeclare protected tag: ExpressionNode;\n\tconstructor(tag: ExpressionNode, quasis: string[], expressions: ExpressionNode[]) {\n\t\tsuper(quasis, expressions, tag);\n\t}\n\toverride getTag(): ExpressionNode {\n\t\treturn super.getTag()!;\n\t}\n}\n\n\n// @Deserializer('BigIntLiteral')\n// export class BigIntLiteral extends Literal<bigint> {\n// \tstatic fromJSON(node: BigIntLiteral): BigIntLiteral {\n// \t\treturn new BigIntLiteral(BigInt(String(node.value)));\n// \t}\n// \ttoString(): string {\n// \t\treturn `${this.value}n`;\n// \t}\n// \ttoJson(): object {\n// \t\treturn { value: this.value.toString() };\n// \t}\n// }\n\n\nexport const TRUE = String(true);\nexport const FALSE = String(false);\n\nexport const NULL = String(null);\nexport const UNDEFINED = String(undefined);\n\nexport const NullNode = Object.freeze(new Literal<null>(null)) as Literal<null>;\nexport const UndefinedNode = Object.freeze(new Literal<undefined>(undefined)) as Literal<undefined>;\nexport const TrueNode = Object.freeze(new Literal<boolean>(true)) as Literal<boolean>;\nexport const FalseNode = Object.freeze(new Literal<boolean>(false)) as Literal<boolean>;\nexport const ThisNode = Object.freeze(new ThisExpression()) as ThisExpression;\nexport const GlobalThisNode = Object.freeze(new Identifier('globalThis')) as Identifier;\nexport const SymbolNode = Object.freeze(new Identifier('Symbol')) as Identifier;\nexport const OfNode = Object.freeze(new Identifier('of')) as Identifier;\nexport const AsNode = Object.freeze(new Identifier('as')) as Identifier;\nexport const DefaultNode = Object.freeze(new Identifier('default')) as Identifier;\nexport const GetIdentifier = Object.freeze(new Identifier('get')) as Identifier;\nexport const SetIdentifier = Object.freeze(new Identifier('set')) as Identifier;\nexport const AsyncIdentifier = Object.freeze(new Identifier('async')) as Identifier;\nexport const AwaitIdentifier = Object.freeze(new Identifier('await')) as Identifier;\nexport const ConstructorIdentifier = Object.freeze(new Identifier('constructor')) as Identifier;\nexport const NameIdentifier = Object.freeze(new Identifier('name')) as Identifier;\nexport const EvalIdentifier = Object.freeze(new Identifier('eval')) as Identifier;\nexport const ArgumentsIdentifier = Object.freeze(new Identifier('arguments')) as Identifier;\nexport const YieldIdentifier = Object.freeze(new Identifier('yield')) as Identifier;\nexport const SuperIdentifier = Object.freeze(new Identifier('super')) as Identifier;\nexport const LetIdentifier = Object.freeze(new Identifier('let')) as Identifier;\n"]}
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../../src/expressions/api/definition/values.ts"],"names":[],"mappings":";;AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;;;GAQG;AAEI,IAAM,UAAU,kBAAhB,MA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,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAe,CAAC;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAe,CAAC;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAe,CAAC;AACpF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAe,CAAC;AACpF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAe,CAAC","sourcesContent":["import type {\n\tDeclarationExpression, ExpressionNode, NodeDeserializer,\n\tCanFindScope, ExpressionEventPath, VisitNodeType\n} from '../expression.js';\nimport type { Context, Scope } from '../../scope/scope.js';\nimport type { Stack } from '../../scope/stack.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { AbstractExpressionNode } from '../abstract.js';\n\n/**\n * An identifier is a sequence of characters in the code that identifies a variable, function, or property.\n * In JavaScript, identifiers are case-sensitive and can contain Unicode letters, $, _, and digits (0-9),\n * but may not start with a digit.\n * An identifier differs from a string in that a string is data,\n * while an identifier is part of the code. In JavaScript,\n * there is no way to convert identifiers to strings,\n * but sometimes it is possible to parse strings into identifiers.\n */\n@Deserializer('Identifier')\nexport class Identifier extends AbstractExpressionNode implements DeclarationExpression, CanFindScope {\n\tstatic fromJSON(node: Identifier): Identifier {\n\t\treturn new Identifier(node.name);\n\t}\n\tconstructor(protected name: string | number) {\n\t\tsuper();\n\t}\n\tgetName() {\n\t\treturn this.name;\n\t}\n\tset(stack: Stack, value: any) {\n\t\treturn stack.set(this.name, value) ? value : void 0;\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tif (thisContext) {\n\t\t\treturn thisContext[this.name];\n\t\t}\n\t\treturn stack.get(this.name);\n\t}\n\tfindScope<T extends object>(stack: Stack): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope: Scope<any>): Scope<T>;\n\tfindScope<T extends object>(stack: Stack, scope?: Scope<any>): Scope<T> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.name);\n\t\t}\n\t\tscope = stack.findScope(this.name);\n\t\treturn scope.getInnerScope(this.name);\n\t}\n\tdeclareVariable(stack: Stack, propertyValue: any): any {\n\t\treturn stack.declareVariable(this.name, propertyValue);\n\t}\n\tgetDeclarationName(): string {\n\t\treturn this.toString();\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [this];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\tconst path: ExpressionEventPath[] = [{ computed: false, path: this.toString() }];\n\t\treturn computed ? [{ computed, path: this.toString(), computedPath: [path] }] : path;\n\t}\n\ttoString(): string {\n\t\treturn String(this.name);\n\t}\n\ttoJson(): object {\n\t\treturn { name: this.name };\n\t}\n}\n\n@Deserializer('ThisExpression')\nexport class ThisExpression extends Identifier {\n\tstatic fromJSON(node: ThisExpression): ThisExpression {\n\t\treturn ThisNode;\n\t}\n\tconstructor() {\n\t\tsuper('this');\n\t}\n}\n\n@Deserializer('Literal')\nexport class Literal<T> extends AbstractExpressionNode implements CanFindScope {\n\tstatic fromJSON(node: Literal<any>):\n\t\tLiteral<string>\n\t\t| Literal<number>\n\t\t| Literal<boolean>\n\t\t| Literal<RegExp>\n\t\t| Literal<bigint>\n\t\t| Literal<null>\n\t\t| Literal<undefined> {\n\t\tif (node.bigint) {\n\t\t\treturn new Literal(BigInt(node.bigint), node.raw, undefined, node.bigint);\n\t\t} else if (node.regex) {\n\t\t\treturn new Literal(RegExp(node.regex.pattern, node.regex.flags), node.raw, node.regex);\n\t\t}\n\t\treturn new Literal(node.value, node.raw);\n\t}\n\tprotected regex?: { pattern: string, flags: string };\n\tprotected bigint?: string;\n\tprotected raw?: string\n\tconstructor(protected value: T, raw?: string, regex?: { pattern: string, flags: string }, bigint?: string) {\n\t\tsuper();\n\t\tif (raw) {\n\t\t\tthis.raw = raw;\n\t\t}\n\t\tif (regex) {\n\t\t\tthis.regex = regex;\n\t\t}\n\t\tif (bigint) {\n\t\t\tthis.bigint = bigint;\n\t\t}\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tgetRegex() {\n\t\treturn this.regex;\n\t}\n\tgetBigint() {\n\t\treturn this.bigint;\n\t}\n\tgeRaw() {\n\t\treturn this.raw;\n\t}\n\tset() {\n\t\tthrow new Error(`${this.constructor.name}#set() has no implementation.`);\n\t}\n\tget(): T {\n\t\treturn this.value;\n\t}\n\tfindScope<V extends Context>(stack: Stack): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope: Scope<Record<PropertyKey, V>>): Scope<V>;\n\tfindScope<V extends Context>(stack: Stack, scope?: Scope<Record<PropertyKey, V>>): Scope<V> | undefined {\n\t\tif (scope) {\n\t\t\treturn scope.getInnerScope(this.value as any);\n\t\t}\n\t\tscope = stack.findScope(this.value as any);\n\t\treturn scope.getInnerScope(this.value as any);\n\t}\n\tdependency(computed: true): ExpressionNode[] {\n\t\treturn computed ? [this] : [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn computed ? [{ computed: false, path: this.toString() }] : [];\n\t}\n\ttoString(): string {\n\t\treturn this.raw ?? String(this.value);\n\t}\n\ttoJson(): object {\n\t\tif (this.bigint) {\n\t\t\treturn {\n\t\t\t\tbigint: this.bigint,\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t} else if (this.regex) {\n\t\t\treturn {\n\t\t\t\tregex: { pattern: this.regex?.pattern, flags: this.regex?.flags },\n\t\t\t\traw: this.raw,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tvalue: this.value,\n\t\t\traw: this.raw,\n\t\t};\n\t}\n}\n\nclass TemplateArray extends Array<string> implements TemplateStringsArray {\n\traw: readonly string[];\n\tconstructor(strings: string[]) {\n\t\tsuper(...strings);\n\t\tthis.raw = strings;\n\t}\n}\n\nexport class TemplateLiteralExpressionNode extends AbstractExpressionNode {\n\tstatic fromJSON(node: TemplateLiteralExpressionNode, deserializer: NodeDeserializer): TemplateLiteralExpressionNode {\n\t\treturn new TemplateLiteralExpressionNode(\n\t\t\tnode.quasis,\n\t\t\tnode.expressions.map(deserializer),\n\t\t\tnode.tag ? deserializer(node.tag) : void 0\n\t\t);\n\t}\n\tstatic visit(node: TemplateLiteralExpressionNode, visitNode: VisitNodeType): void {\n\t\tnode.tag && visitNode(node.tag);\n\t\tnode.expressions.forEach(visitNode);\n\t}\n\tconstructor(protected quasis: string[], protected expressions: ExpressionNode[], protected tag?: ExpressionNode,) {\n\t\tsuper();\n\t}\n\tgetTag() {\n\t\treturn this.tag;\n\t}\n\tgetExpressions() {\n\t\treturn this.expressions;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error(`TemplateLiteralExpressionNode#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst tagged: Function = this.tag?.get(stack) || String.raw;\n\t\tconst templateStringsArray = new TemplateArray(this.quasis);\n\t\ttemplateStringsArray.raw = templateStringsArray;\n\t\tconst values = this.expressions.map(expr => expr.get(stack));\n\t\treturn tagged(templateStringsArray, ...values);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependency(computed));\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn this.expressions.flatMap(exp => exp.dependencyPath(computed));\n\t}\n\ttoString(): string {\n\t\tlet str = this.tag?.toString() || '';\n\t\tstr += '`';\n\t\tlet i = 0;\n\t\tfor (; i < this.quasis.length - 1; i++) {\n\t\t\tstr += this.quasis[i];\n\t\t\tstr += '${';\n\t\t\tstr += this.expressions[i].toString();\n\t\t\tstr += '}';\n\t\t}\n\t\tstr += this.quasis[i];\n\t\tstr += '`';\n\t\treturn str;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tquasis: this.quasis,\n\t\t\texpressions: this.expressions.map(expr => expr.toJSON()),\n\t\t\ttag: this.tag?.toJSON(),\n\t\t};\n\t}\n}\n\n@Deserializer('TemplateLiteral')\nexport class TemplateLiteral extends TemplateLiteralExpressionNode {\n\tdeclare protected tag: undefined;\n\tconstructor(quasis: string[], expressions: ExpressionNode[]) {\n\t\tsuper(quasis, expressions);\n\t}\n\toverride getTag(): undefined {\n\t\treturn undefined;\n\t}\n}\n\n@Deserializer('TaggedTemplateExpression')\nexport class TaggedTemplateExpression extends TemplateLiteralExpressionNode {\n\tdeclare protected tag: ExpressionNode;\n\tconstructor(tag: ExpressionNode, quasis: string[], expressions: ExpressionNode[]) {\n\t\tsuper(quasis, expressions, tag);\n\t}\n\toverride getTag(): ExpressionNode {\n\t\treturn super.getTag()!;\n\t}\n}\n\n\nexport const TRUE = String(true);\nexport const FALSE = String(false);\n\nexport const NULL = String(null);\nexport const UNDEFINED = String(undefined);\n\nexport const NullNode = Object.freeze(new Literal<null>(null)) as Literal<null>;\nexport const UndefinedNode = Object.freeze(new Literal<undefined>(undefined)) as Literal<undefined>;\nexport const TrueNode = Object.freeze(new Literal<boolean>(true)) as Literal<boolean>;\nexport const FalseNode = Object.freeze(new Literal<boolean>(false)) as Literal<boolean>;\nexport const ThisNode = Object.freeze(new ThisExpression()) as ThisExpression;\nexport const GlobalThisNode = Object.freeze(new Identifier('globalThis')) as Identifier;\nexport const SymbolNode = Object.freeze(new Identifier('Symbol')) as Identifier;\nexport const OfNode = Object.freeze(new Identifier('of')) as Identifier;\nexport const AsNode = Object.freeze(new Identifier('as')) as Identifier;\nexport const DefaultNode = Object.freeze(new Identifier('default')) as Identifier;\nexport const GetIdentifier = Object.freeze(new Identifier('get')) as Identifier;\nexport const SetIdentifier = Object.freeze(new Identifier('set')) as Identifier;\nexport const AsyncIdentifier = Object.freeze(new Identifier('async')) as Identifier;\nexport const AwaitIdentifier = Object.freeze(new Identifier('await')) as Identifier;\nexport const ConstructorIdentifier = Object.freeze(new Identifier('constructor')) as Identifier;\nexport const NameIdentifier = Object.freeze(new Identifier('name')) as Identifier;\nexport const EvalIdentifier = Object.freeze(new Identifier('eval')) as Identifier;\nexport const ArgumentsIdentifier = Object.freeze(new Identifier('arguments')) as Identifier;\nexport const YieldIdentifier = Object.freeze(new Identifier('yield')) as Identifier;\nexport const SuperIdentifier = Object.freeze(new Identifier('super')) as Identifier;\nexport const LetIdentifier = Object.freeze(new Identifier('let')) as Identifier;\n"]}
|
package/api/expression.d.ts
CHANGED
|
@@ -21,26 +21,6 @@ export declare type ExpressionEventMap = {
|
|
|
21
21
|
[key: string]: ExpressionEventMap;
|
|
22
22
|
};
|
|
23
23
|
export interface ExpressionNode {
|
|
24
|
-
/**
|
|
25
|
-
* pass scope list from outer function to inner function,
|
|
26
|
-
*
|
|
27
|
-
* all other end point expression should do nothing,
|
|
28
|
-
* if this function executed.
|
|
29
|
-
*
|
|
30
|
-
* @param scopeList all outer function scopes given to the inner function,
|
|
31
|
-
* this solution ignore the fact that some inner function has no need to
|
|
32
|
-
* get shared variables, as its implementation never say that
|
|
33
|
-
* ```js
|
|
34
|
-
* function f(d) {
|
|
35
|
-
* function g() {
|
|
36
|
-
* const a = ({ d }) => d;
|
|
37
|
-
* return a;
|
|
38
|
-
* }
|
|
39
|
-
* return [d, g];
|
|
40
|
-
* }
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
shareVariables(scopeList: Scope<Context>[]): void;
|
|
44
24
|
/**
|
|
45
25
|
* assign the value to this expression in stack.
|
|
46
26
|
*
|
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,KAAiB;QACtC,KAAK,EAAE,CAAC;QADa,UAAK,GAAL,KAAK,CAAY;IAEvC,CAAC;IACD,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,YAAY;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM;QACL,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;SAC1B,CAAC;IACH,CAAC;CACD;AAKM,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,sBAAsB;IAY1D,YAAoB,GAAiC,EAAU,KAAsB;QACpF,KAAK,EAAE,CAAC;QADW,QAAG,GAAH,GAAG,CAA8B;QAAU,UAAK,GAAL,KAAK,CAAiB;IAErF,CAAC;IAbD,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,YAA8B;QACpE,OAAO,IAAI,iBAAe,CACzB,YAAY,CAAC,IAAI,CAAC,GAAG,CAAe,EACpC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAoB,CAC3C,CAAC;IACH,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,IAAqB,EAAE,SAAwB;QAC3D,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAKD,MAAM;QACL,OAAO,IAAI,CAAC,GAAG,CAAC;IACjB,CAAC;IACD,QAAQ;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,KAAU;QAC3B,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IACD,GAAG,CAAC,KAAY,EAAE,WAAiB;QAClC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/export.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAMH,OAAO,EAAiB,aAAa,EAAS,MAAM,sBAAsB,CAAC;AAE3E,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;AAK/D;;;;;;;;;;;;;GAaG;AAEH,IAAa,eAAe,uBAA5B,MAAa,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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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;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","sourceRo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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
|
}
|