@ibyar/expressions 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +0 -3
  2. package/api/abstract.d.ts +6 -2
  3. package/api/abstract.js +15 -8
  4. package/api/abstract.js.map +1 -1
  5. package/api/class/class.d.ts +15 -18
  6. package/api/class/class.js +49 -61
  7. package/api/class/class.js.map +1 -1
  8. package/api/class/decorator.d.ts +2 -2
  9. package/api/class/decorator.js +6 -6
  10. package/api/class/decorator.js.map +1 -1
  11. package/api/computing/call.d.ts +2 -2
  12. package/api/computing/call.js +8 -8
  13. package/api/computing/call.js.map +1 -1
  14. package/api/computing/debugger.d.ts +1 -2
  15. package/api/computing/debugger.js +2 -3
  16. package/api/computing/debugger.js.map +1 -1
  17. package/api/computing/new.d.ts +2 -2
  18. package/api/computing/new.js +7 -7
  19. package/api/computing/new.js.map +1 -1
  20. package/api/computing/rest.d.ts +2 -2
  21. package/api/computing/rest.js +6 -6
  22. package/api/computing/rest.js.map +1 -1
  23. package/api/computing/return.d.ts +2 -2
  24. package/api/computing/return.js +6 -6
  25. package/api/computing/return.js.map +1 -1
  26. package/api/computing/spread.d.ts +2 -2
  27. package/api/computing/spread.js +6 -6
  28. package/api/computing/spread.js.map +1 -1
  29. package/api/computing/throw.d.ts +4 -4
  30. package/api/computing/throw.js +18 -18
  31. package/api/computing/throw.js.map +1 -1
  32. package/api/computing/yield.d.ts +2 -2
  33. package/api/computing/yield.js +7 -7
  34. package/api/computing/yield.js.map +1 -1
  35. package/api/definition/array.d.ts +3 -3
  36. package/api/definition/array.js +14 -14
  37. package/api/definition/array.js.map +1 -1
  38. package/api/definition/bind.d.ts +2 -2
  39. package/api/definition/bind.js +9 -9
  40. package/api/definition/bind.js.map +1 -1
  41. package/api/definition/comment.d.ts +3 -3
  42. package/api/definition/comment.js +6 -6
  43. package/api/definition/comment.js.map +1 -1
  44. package/api/definition/function.d.ts +17 -16
  45. package/api/definition/function.js +60 -55
  46. package/api/definition/function.js.map +1 -1
  47. package/api/definition/member.d.ts +2 -2
  48. package/api/definition/member.js +13 -9
  49. package/api/definition/member.js.map +1 -1
  50. package/api/definition/object.d.ts +4 -4
  51. package/api/definition/object.js +22 -22
  52. package/api/definition/object.js.map +1 -1
  53. package/api/definition/statement.d.ts +2 -2
  54. package/api/definition/statement.js +6 -6
  55. package/api/definition/statement.js.map +1 -1
  56. package/api/definition/values.d.ts +15 -37
  57. package/api/definition/values.js +49 -74
  58. package/api/definition/values.js.map +1 -1
  59. package/api/expression.d.ts +42 -8
  60. package/api/expression.js.map +1 -1
  61. package/api/index.d.ts +1 -0
  62. package/api/index.js +1 -0
  63. package/api/index.js.map +1 -1
  64. package/api/module/common.d.ts +3 -3
  65. package/api/module/common.js +9 -9
  66. package/api/module/common.js.map +1 -1
  67. package/api/module/export.d.ts +5 -5
  68. package/api/module/export.js +30 -29
  69. package/api/module/export.js.map +1 -1
  70. package/api/module/import.d.ts +4 -4
  71. package/api/module/import.js +24 -23
  72. package/api/module/import.js.map +1 -1
  73. package/api/operators/assignment.d.ts +3 -3
  74. package/api/operators/assignment.js +5 -5
  75. package/api/operators/assignment.js.map +1 -1
  76. package/api/operators/await.d.ts +3 -3
  77. package/api/operators/await.js +7 -7
  78. package/api/operators/await.js.map +1 -1
  79. package/api/operators/binary.d.ts +1 -1
  80. package/api/operators/binary.js +1 -1
  81. package/api/operators/binary.js.map +1 -1
  82. package/api/operators/chaining.d.ts +2 -2
  83. package/api/operators/chaining.js +6 -6
  84. package/api/operators/chaining.js.map +1 -1
  85. package/api/operators/comma.d.ts +2 -2
  86. package/api/operators/comma.js +6 -6
  87. package/api/operators/comma.js.map +1 -1
  88. package/api/operators/grouping.d.ts +2 -2
  89. package/api/operators/grouping.js +6 -6
  90. package/api/operators/grouping.js.map +1 -1
  91. package/api/operators/logical.d.ts +1 -1
  92. package/api/operators/logical.js +1 -1
  93. package/api/operators/logical.js.map +1 -1
  94. package/api/operators/pipeline.d.ts +3 -3
  95. package/api/operators/pipeline.js +8 -8
  96. package/api/operators/pipeline.js.map +1 -1
  97. package/api/operators/ternary.d.ts +2 -2
  98. package/api/operators/ternary.js +8 -8
  99. package/api/operators/ternary.js.map +1 -1
  100. package/api/operators/types.d.ts +1 -1
  101. package/api/operators/unary.d.ts +3 -3
  102. package/api/operators/unary.js +7 -7
  103. package/api/operators/unary.js.map +1 -1
  104. package/api/operators/update.d.ts +3 -3
  105. package/api/operators/update.js +8 -8
  106. package/api/operators/update.js.map +1 -1
  107. package/api/program.d.ts +3 -3
  108. package/api/program.js +7 -7
  109. package/api/program.js.map +1 -1
  110. package/api/statement/control/block.d.ts +2 -2
  111. package/api/statement/control/block.js +6 -6
  112. package/api/statement/control/block.js.map +1 -1
  113. package/api/statement/control/empty.d.ts +2 -3
  114. package/api/statement/control/empty.js +6 -7
  115. package/api/statement/control/empty.js.map +1 -1
  116. package/api/statement/control/if.d.ts +2 -2
  117. package/api/statement/control/if.js +8 -8
  118. package/api/statement/control/if.js.map +1 -1
  119. package/api/statement/control/switch.d.ts +4 -6
  120. package/api/statement/control/switch.js +19 -20
  121. package/api/statement/control/switch.js.map +1 -1
  122. package/api/statement/control/terminate.d.ts +4 -4
  123. package/api/statement/control/terminate.js +11 -15
  124. package/api/statement/control/terminate.js.map +1 -1
  125. package/api/statement/control/with.d.ts +21 -0
  126. package/api/statement/control/with.js +67 -0
  127. package/api/statement/control/with.js.map +1 -0
  128. package/api/statement/declarations/declares.d.ts +4 -4
  129. package/api/statement/declarations/declares.js +14 -14
  130. package/api/statement/declarations/declares.js.map +1 -1
  131. package/api/statement/iterations/for.d.ts +7 -7
  132. package/api/statement/iterations/for.js +35 -35
  133. package/api/statement/iterations/for.js.map +1 -1
  134. package/api/statement/iterations/while.d.ts +3 -3
  135. package/api/statement/iterations/while.js +14 -14
  136. package/api/statement/iterations/while.js.map +1 -1
  137. package/package.json +14 -4
  138. package/scope/finalizer.d.ts +1 -1
  139. package/scope/pool.d.ts +1 -1
  140. package/scope/proxy.d.ts +1 -1
  141. package/scope/proxy.js +1 -0
  142. package/scope/proxy.js.map +1 -1
  143. package/scope/scope.d.ts +2 -2
  144. package/scope/scope.js +13 -16
  145. package/scope/scope.js.map +1 -1
  146. package/scope/stack.js +23 -23
  147. package/scope/stack.js.map +1 -1
  148. package/v8/enums.d.ts +4 -2
  149. package/v8/enums.js.map +1 -1
  150. package/v8/factory.d.ts +148 -0
  151. package/v8/factory.js +499 -0
  152. package/v8/factory.js.map +1 -0
  153. package/v8/inline.d.ts +49 -49
  154. package/v8/inline.js +314 -305
  155. package/v8/inline.js.map +1 -1
  156. package/v8/node.d.ts +141 -0
  157. package/v8/node.js +2 -0
  158. package/v8/node.js.map +1 -0
  159. package/v8/nodes.d.ts +0 -14
  160. package/v8/nodes.js +1 -152
  161. package/v8/nodes.js.map +1 -1
  162. package/v8/parser.d.ts +21 -18
  163. package/v8/parser.js +97 -84
  164. package/v8/parser.js.map +1 -1
  165. package/v8/stream.d.ts +2 -1
  166. package/v8/stream.js +221 -311
  167. package/v8/stream.js.map +1 -1
  168. package/v8/token.d.ts +3 -1
  169. package/v8/token.js +7 -5
  170. package/v8/token.js.map +1 -1
  171. package/visit/visitor.d.ts +1 -1
@@ -1,26 +1,60 @@
1
1
  import type { Scope, Context } from '../scope/scope.js';
2
2
  import type { Stack } from '../scope/stack.js';
3
3
  import { TypeOf } from './utils.js';
4
- export declare type NodeType = {
4
+ /**
5
+ * Each Position object consists of
6
+ * a line number (1-indexed)
7
+ * and a column number (0-indexed)
8
+ */
9
+ export interface Position {
10
+ line: number;
11
+ column: number;
12
+ }
13
+ export interface SourceLocation {
14
+ source?: string | null;
15
+ start: Position;
16
+ end: Position;
17
+ }
18
+ export type NodeType = {
5
19
  type: string;
6
20
  };
7
- export declare type NodeJsonType = {
21
+ export type NodeJsonType = {
8
22
  [key: string]: any;
9
23
  } & NodeType;
10
- export declare type ExpressionEventPathDotNotation = {
24
+ export type ExpressionEventPathDotNotation = {
11
25
  computed: false;
12
26
  path: string;
13
27
  };
14
- export declare type ExpressionEventPathBracketNotation = {
28
+ export type ExpressionEventPathBracketNotation = {
15
29
  computed: true;
16
30
  path: string;
17
31
  computedPath: ExpressionEventPath[][];
18
32
  };
19
- export declare type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEventPathBracketNotation;
20
- export declare type ExpressionEventMap = {
33
+ export type ExpressionEventPath = ExpressionEventPathDotNotation | ExpressionEventPathBracketNotation;
34
+ export type ExpressionEventMap = {
21
35
  [key: string]: ExpressionEventMap;
22
36
  };
23
37
  export interface ExpressionNode {
38
+ /**
39
+ * The `type` field is a string representing the AST variant type.
40
+ * Each subtype of `Node` is documented below with the specific string of its type field.
41
+ * You can use this field to determine which interface a node implements.
42
+ */
43
+ type: string;
44
+ /**
45
+ * The `loc` field represents the source location information of the node.
46
+ * If the node contains no information about the source location,
47
+ * the field is `null` or `undefined`;
48
+ * otherwise it is an object consisting of
49
+ * a start position (the position of the first character of the parsed source region)
50
+ * and an end position (the position of the first character after the parsed source region):
51
+ * and offset index (the position of the first character)
52
+ */
53
+ loc?: SourceLocation;
54
+ /**
55
+ * start and end position offset
56
+ */
57
+ range?: [number, number];
24
58
  /**
25
59
  * assign the value to this expression in stack.
26
60
  *
@@ -120,8 +154,8 @@ export interface ExpressionNode {
120
154
  */
121
155
  getClass(): ExpressionNodConstructor<ExpressionNode>;
122
156
  }
123
- export declare type NodeDeserializer<N = ExpressionNode> = (node: N) => N;
124
- export declare type VisitNodeType = (expression: ExpressionNode) => void;
157
+ export type NodeDeserializer<N = ExpressionNode> = (node: N) => N;
158
+ export type VisitNodeType = (expression: ExpressionNode) => void;
125
159
  /**
126
160
  * this is how to:
127
161
  * describe a class with it's static functions and properties
@@ -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 * 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"]}
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\n\n/**\n * Each Position object consists of \n * a line number (1-indexed) \n * and a column number (0-indexed)\n */\nexport interface Position {\n\tline: number; // >= 1\n\tcolumn: number; // >= 0\n}\n\nexport interface SourceLocation {\n\tsource?: string | null;\n\tstart: Position;\n\tend: Position;\n}\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 * The `type` field is a string representing the AST variant type.\n\t * Each subtype of `Node` is documented below with the specific string of its type field.\n\t * You can use this field to determine which interface a node implements.\n\t */\n\ttype: string;\n\n\t/**\n\t * The `loc` field represents the source location information of the node.\n\t * If the node contains no information about the source location,\n\t * the field is `null` or `undefined`;\n\t * otherwise it is an object consisting of \n\t * a start position (the position of the first character of the parsed source region)\n\t * and an end position (the position of the first character after the parsed source region):\n\t * and offset index (the position of the first character) \n\t */\n\tloc?: SourceLocation;\n\n\t/**\n\t * start and end position offset\n\t */\n\trange?: [number, number];\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/index.d.ts CHANGED
@@ -35,6 +35,7 @@ export * from './statement/control/empty.js';
35
35
  export * from './statement/control/if.js';
36
36
  export * from './statement/control/switch.js';
37
37
  export * from './statement/control/terminate.js';
38
+ export * from './statement/control/with.js';
38
39
  export * from './statement/declarations/declares.js';
39
40
  export * from './statement/iterations/for.js';
40
41
  export * from './statement/iterations/while.js';
package/api/index.js CHANGED
@@ -35,6 +35,7 @@ export * from './statement/control/empty.js';
35
35
  export * from './statement/control/if.js';
36
36
  export * from './statement/control/switch.js';
37
37
  export * from './statement/control/terminate.js';
38
+ export * from './statement/control/with.js';
38
39
  export * from './statement/declarations/declares.js';
39
40
  export * from './statement/iterations/for.js';
40
41
  export * from './statement/iterations/while.js';
package/api/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/expressions/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,cAAc,8BAA8B,CAAC;AAE7C,cAAc,cAAc,CAAC;AAE7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AAErC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,sCAAsC,CAAC;AAErD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './expression.js';\nexport * from './abstract.js';\n\nexport * from './deserialize/deserialize.js';\n\nexport * from './program.js';\n\nexport * from './definition/values.js';\nexport * from './definition/array.js';\nexport * from './definition/comment.js';\nexport * from './definition/function.js';\nexport * from './definition/member.js';\nexport * from './definition/bind.js';\nexport * from './definition/object.js';\nexport * from './definition/statement.js';\n\nexport * from './computing/call.js';\nexport * from './computing/debugger.js';\nexport * from './computing/new.js';\nexport * from './computing/return.js';\nexport * from './computing/spread.js';\nexport * from './computing/rest.js';\nexport * from './computing/throw.js';\nexport * from './computing/yield.js';\n\nexport * from './operators/assignment.js';\nexport * from './operators/await.js';\nexport * from './operators/binary.js';\nexport * from './operators/chaining.js';\nexport * from './operators/comma.js';\nexport * from './operators/grouping.js';\nexport * from './operators/logical.js';\nexport * from './operators/pipeline.js';\nexport * from './operators/ternary.js';\nexport * from './operators/types.js';\nexport * from './operators/unary.js';\nexport * from './operators/update.js';\n\nexport * from './statement/control/block.js';\nexport * from './statement/control/empty.js';\nexport * from './statement/control/if.js';\nexport * from './statement/control/switch.js';\nexport * from './statement/control/terminate.js';\n\nexport * from './statement/declarations/declares.js';\n\nexport * from './statement/iterations/for.js';\nexport * from './statement/iterations/while.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/expressions/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,cAAc,8BAA8B,CAAC;AAE7C,cAAc,cAAc,CAAC;AAE7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AAErC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAEtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAE5C,cAAc,sCAAsC,CAAC;AAErD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './expression.js';\nexport * from './abstract.js';\n\nexport * from './deserialize/deserialize.js';\n\nexport * from './program.js';\n\nexport * from './definition/values.js';\nexport * from './definition/array.js';\nexport * from './definition/comment.js';\nexport * from './definition/function.js';\nexport * from './definition/member.js';\nexport * from './definition/bind.js';\nexport * from './definition/object.js';\nexport * from './definition/statement.js';\n\nexport * from './computing/call.js';\nexport * from './computing/debugger.js';\nexport * from './computing/new.js';\nexport * from './computing/return.js';\nexport * from './computing/spread.js';\nexport * from './computing/rest.js';\nexport * from './computing/throw.js';\nexport * from './computing/yield.js';\n\nexport * from './operators/assignment.js';\nexport * from './operators/await.js';\nexport * from './operators/binary.js';\nexport * from './operators/chaining.js';\nexport * from './operators/comma.js';\nexport * from './operators/grouping.js';\nexport * from './operators/logical.js';\nexport * from './operators/pipeline.js';\nexport * from './operators/ternary.js';\nexport * from './operators/types.js';\nexport * from './operators/unary.js';\nexport * from './operators/update.js';\n\nexport * from './statement/control/block.js';\nexport * from './statement/control/empty.js';\nexport * from './statement/control/if.js';\nexport * from './statement/control/switch.js';\nexport * from './statement/control/terminate.js';\nexport * from './statement/control/with.js';\n\nexport * from './statement/declarations/declares.js';\n\nexport * from './statement/iterations/for.js';\nexport * from './statement/iterations/while.js';\n"]}
@@ -1,10 +1,10 @@
1
+ import type { ExpressionEventPath, ExpressionNode, NodeDeserializer, SourceLocation, VisitNodeType } from '../expression.js';
1
2
  import { Stack } from '../../scope/stack.js';
2
3
  import { AbstractExpressionNode } from '../abstract.js';
3
4
  import { Identifier, Literal } from '../definition/values.js';
4
- import { ExpressionEventPath, ExpressionNode, NodeDeserializer, VisitNodeType } from '../expression.js';
5
5
  export declare abstract class ModuleSpecifier extends AbstractExpressionNode {
6
6
  protected local: Identifier;
7
- constructor(local: Identifier);
7
+ constructor(local: Identifier, range?: [number, number], loc?: SourceLocation);
8
8
  getLocal(): Identifier;
9
9
  getLocalName(): string | number;
10
10
  toJson(): object;
@@ -14,7 +14,7 @@ export declare class ImportAttribute extends AbstractExpressionNode {
14
14
  private value;
15
15
  static fromJSON(node: ImportAttribute, deserializer: NodeDeserializer): ImportAttribute;
16
16
  static visit(node: ImportAttribute, visitNode: VisitNodeType): void;
17
- constructor(key: Identifier | Literal<string>, value: Literal<string>);
17
+ constructor(key: Identifier | Literal<string>, value: Literal<string>, range?: [number, number], loc?: SourceLocation);
18
18
  getKey(): Identifier | Literal<string>;
19
19
  getValue(): Literal<string>;
20
20
  set(stack: Stack, value: any): void;
@@ -4,8 +4,8 @@ import { AbstractExpressionNode } from '../abstract.js';
4
4
  import { Literal } from '../definition/values.js';
5
5
  import { Deserializer } from '../deserialize/deserialize.js';
6
6
  export class ModuleSpecifier extends AbstractExpressionNode {
7
- constructor(local) {
8
- super();
7
+ constructor(local, range, loc) {
8
+ super(range, loc);
9
9
  this.local = local;
10
10
  }
11
11
  getLocal() {
@@ -21,18 +21,18 @@ export class ModuleSpecifier extends AbstractExpressionNode {
21
21
  }
22
22
  }
23
23
  let ImportAttribute = ImportAttribute_1 = class ImportAttribute extends AbstractExpressionNode {
24
- constructor(key, value) {
25
- super();
26
- this.key = key;
27
- this.value = value;
28
- }
29
24
  static fromJSON(node, deserializer) {
30
- return new ImportAttribute_1(deserializer(node.key), deserializer(node.value));
25
+ return new ImportAttribute_1(deserializer(node.key), deserializer(node.value), node.range, node.loc);
31
26
  }
32
27
  static visit(node, visitNode) {
33
28
  visitNode(node.key);
34
29
  visitNode(node.value);
35
30
  }
31
+ constructor(key, value, range, loc) {
32
+ super(range, loc);
33
+ this.key = key;
34
+ this.value = value;
35
+ }
36
36
  getKey() {
37
37
  return this.key;
38
38
  }
@@ -65,7 +65,7 @@ let ImportAttribute = ImportAttribute_1 = class ImportAttribute extends Abstract
65
65
  };
66
66
  ImportAttribute = ImportAttribute_1 = __decorate([
67
67
  Deserializer('ImportAttribute'),
68
- __metadata("design:paramtypes", [Object, Literal])
68
+ __metadata("design:paramtypes", [Object, Literal, Array, Object])
69
69
  ], ImportAttribute);
70
70
  export { ImportAttribute };
71
71
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
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,C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ACX,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"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/common.ts"],"names":[],"mappings":";;AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAc,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,OAAgB,eAAgB,SAAQ,sBAAsB;IACnE,YAAsB,KAAiB,EAAE,KAAwB,EAAE,GAAoB;QACtF,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QADG,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;IAC1D,MAAM,CAAC,QAAQ,CAAC,IAAqB,EAAE,YAA8B;QACpE,OAAO,IAAI,iBAAe,CACzB,YAAY,CAAC,IAAI,CAAC,GAAG,CAAe,E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AAC,MAAM,EAAE;YACtB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;SAC1B,CAAC;IACH,CAAC;CACD,CAAA;AAlDY,eAAe;IAD3B,YAAY,CAAC,iBAAiB,CAAC;6CAiBf,OAAO;GAhBX,eAAe,CAkD3B;SAlDY,eAAe","sourcesContent":["import type {\n\tExpressionEventPath, ExpressionNode, NodeDeserializer,\n\tSourceLocation, VisitNodeType\n} from '../expression.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\n\nexport abstract class ModuleSpecifier extends AbstractExpressionNode {\n\tconstructor(protected local: Identifier, range?: [number, number], loc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetLocal() {\n\t\treturn this.local;\n\t}\n\tgetLocalName() {\n\t\treturn this.local.getName();\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON()\n\t\t};\n\t}\n}\n\n\n\n@Deserializer('ImportAttribute')\nexport class ImportAttribute extends AbstractExpressionNode {\n\tstatic fromJSON(node: ImportAttribute, deserializer: NodeDeserializer): ImportAttribute {\n\t\treturn new ImportAttribute(\n\t\t\tdeserializer(node.key) as Identifier,\n\t\t\tdeserializer(node.value) as Literal<string>,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ImportAttribute, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.key);\n\t\tvisitNode(node.value);\n\t}\n\n\tconstructor(\n\t\tprivate key: Identifier | Literal<string>,\n\t\tprivate value: Literal<string>,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetKey() {\n\t\treturn this.key;\n\t}\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any): { [key: string]: string } {\n\t\tconst key = this.key.get(stack);\n\t\tconst value = this.value.get();\n\t\treturn { [key]: value };\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\treturn `${this.key.toString()}: ${this.value.toString()}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tkey: this.key.toJSON(),\n\t\t\tvalue: this.value.toJSON(),\n\t\t};\n\t}\n}\n"]}
@@ -31,7 +31,7 @@
31
31
  * export { import1 as name1, import2 as name2, …, nameN } from …;
32
32
  * export { default, … } from …;
33
33
  */
34
- import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType, DeclarationExpression } from '../expression.js';
34
+ import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType, DeclarationExpression, SourceLocation } from '../expression.js';
35
35
  import { Stack } from '../../scope/stack.js';
36
36
  import { AbstractExpressionNode } from '../abstract.js';
37
37
  import { Identifier, Literal } from '../definition/values.js';
@@ -56,7 +56,7 @@ export declare class ExportSpecifier extends ModuleSpecifier {
56
56
  private exported;
57
57
  static fromJSON(node: ExportSpecifier, deserializer: NodeDeserializer): ExportSpecifier;
58
58
  static visit(node: ExportSpecifier, visitNode: VisitNodeType): void;
59
- constructor(local: Identifier, exported: Identifier);
59
+ constructor(local: Identifier, exported: Identifier, range?: [number, number], loc?: SourceLocation);
60
60
  getExported(): Identifier;
61
61
  set(stack: Stack, value: any): void;
62
62
  get(stack: Stack, thisContext?: any): void;
@@ -80,7 +80,7 @@ export declare class ExportNamedDeclaration extends AbstractExpressionNode {
80
80
  private assertions?;
81
81
  static fromJSON(node: ExportNamedDeclaration, deserializer: NodeDeserializer): ExportNamedDeclaration;
82
82
  static visit(node: ExportNamedDeclaration, visitNode: VisitNodeType): void;
83
- constructor(specifiers: ExportSpecifier[], declaration?: DeclarationExpression | undefined, source?: Literal<string> | undefined, assertions?: ImportAttribute[] | undefined);
83
+ constructor(specifiers: ExportSpecifier[], declaration?: DeclarationExpression | undefined, source?: Literal<string> | undefined, assertions?: ImportAttribute[] | undefined, range?: [number, number], loc?: SourceLocation);
84
84
  getSource(): Literal<string> | undefined;
85
85
  getSpecifiers(): ExportSpecifier[];
86
86
  getDeclaration(): DeclarationExpression | undefined;
@@ -104,7 +104,7 @@ export declare class ExportDefaultDeclaration extends AbstractExpressionNode {
104
104
  private declaration;
105
105
  static fromJSON(node: ExportDefaultDeclaration, deserializer: NodeDeserializer): ExportDefaultDeclaration;
106
106
  static visit(node: ExportDefaultDeclaration, visitNode: VisitNodeType): void;
107
- constructor(declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode);
107
+ constructor(declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode, range?: [number, number], loc?: SourceLocation);
108
108
  getDeclaration(): ExpressionNode | FunctionDeclaration | ClassDeclaration;
109
109
  set(stack: Stack): void;
110
110
  get(stack: Stack): void;
@@ -122,7 +122,7 @@ export declare class ExportAllDeclaration extends AbstractExpressionNode {
122
122
  private assertions?;
123
123
  static fromJSON(node: ExportAllDeclaration, deserializer: NodeDeserializer): ExportAllDeclaration;
124
124
  static visit(node: ExportAllDeclaration, visitNode: VisitNodeType): void;
125
- constructor(source: Literal<string>, exported?: Identifier | undefined, assertions?: ImportAttribute[] | undefined);
125
+ constructor(source: Literal<string>, exported?: Identifier | undefined, assertions?: ImportAttribute[] | undefined, range?: [number, number], loc?: SourceLocation);
126
126
  getSource(): Literal<string>;
127
127
  getExported(): Identifier | undefined;
128
128
  getAssertions(): ImportAttribute[] | undefined;
@@ -53,17 +53,17 @@ import { ModuleSpecifier } from './common.js';
53
53
  * and the `local` field is an `Identifier` node representing `bar`.
54
54
  */
55
55
  let ExportSpecifier = ExportSpecifier_1 = class ExportSpecifier extends ModuleSpecifier {
56
- constructor(local, exported) {
57
- super(local);
58
- this.exported = exported;
59
- }
60
56
  static fromJSON(node, deserializer) {
61
- return new ExportSpecifier_1(deserializer(node.local), deserializer(node.exported));
57
+ return new ExportSpecifier_1(deserializer(node.local), deserializer(node.exported), node.range, node.loc);
62
58
  }
63
59
  static visit(node, visitNode) {
64
60
  visitNode(node.local);
65
61
  visitNode(node.exported);
66
62
  }
63
+ constructor(local, exported, range, loc) {
64
+ super(local, range, loc);
65
+ this.exported = exported;
66
+ }
67
67
  getExported() {
68
68
  return this.exported;
69
69
  }
@@ -96,7 +96,8 @@ let ExportSpecifier = ExportSpecifier_1 = class ExportSpecifier extends ModuleSp
96
96
  };
97
97
  ExportSpecifier = ExportSpecifier_1 = __decorate([
98
98
  Deserializer('ExportSpecifier'),
99
- __metadata("design:paramtypes", [Identifier, Identifier])
99
+ __metadata("design:paramtypes", [Identifier,
100
+ Identifier, Array, Object])
100
101
  ], ExportSpecifier);
101
102
  export { ExportSpecifier };
102
103
  /**
@@ -108,15 +109,8 @@ export { ExportSpecifier };
108
109
  * Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.
109
110
  */
110
111
  let ExportNamedDeclaration = ExportNamedDeclaration_1 = class ExportNamedDeclaration extends AbstractExpressionNode {
111
- constructor(specifiers, declaration, source, assertions) {
112
- super();
113
- this.specifiers = specifiers;
114
- this.declaration = declaration;
115
- this.source = source;
116
- this.assertions = assertions;
117
- }
118
112
  static fromJSON(node, deserializer) {
119
- return new ExportNamedDeclaration_1(node.specifiers.map(deserializer), node.declaration ? deserializer(node.declaration) : void 0, node.source ? deserializer(node.source) : void 0, node.assertions ? node.assertions.map(deserializer) : void 0);
113
+ return new ExportNamedDeclaration_1(node.specifiers.map(deserializer), node.declaration ? deserializer(node.declaration) : void 0, node.source ? deserializer(node.source) : void 0, node.assertions ? node.assertions.map(deserializer) : void 0, node.range, node.loc);
120
114
  }
121
115
  static visit(node, visitNode) {
122
116
  node.specifiers.map(visitNode);
@@ -124,6 +118,13 @@ let ExportNamedDeclaration = ExportNamedDeclaration_1 = class ExportNamedDeclara
124
118
  node.declaration && visitNode(node.declaration);
125
119
  node.assertions?.forEach(visitNode);
126
120
  }
121
+ constructor(specifiers, declaration, source, assertions, range, loc) {
122
+ super(range, loc);
123
+ this.specifiers = specifiers;
124
+ this.declaration = declaration;
125
+ this.source = source;
126
+ this.assertions = assertions;
127
+ }
127
128
  getSource() {
128
129
  return this.source;
129
130
  }
@@ -238,7 +239,7 @@ let ExportNamedDeclaration = ExportNamedDeclaration_1 = class ExportNamedDeclara
238
239
  };
239
240
  ExportNamedDeclaration = ExportNamedDeclaration_1 = __decorate([
240
241
  Deserializer('ExportNamedDeclaration'),
241
- __metadata("design:paramtypes", [Array, Object, Literal, Array])
242
+ __metadata("design:paramtypes", [Array, Object, Literal, Array, Array, Object])
242
243
  ], ExportNamedDeclaration);
243
244
  export { ExportNamedDeclaration };
244
245
  /**
@@ -247,16 +248,16 @@ export { ExportNamedDeclaration };
247
248
  * or `export default 1;`.
248
249
  */
249
250
  let ExportDefaultDeclaration = ExportDefaultDeclaration_1 = class ExportDefaultDeclaration extends AbstractExpressionNode {
250
- constructor(declaration) {
251
- super();
252
- this.declaration = declaration;
253
- }
254
251
  static fromJSON(node, deserializer) {
255
- return new ExportDefaultDeclaration_1(deserializer(node.declaration));
252
+ return new ExportDefaultDeclaration_1(deserializer(node.declaration), node.range, node.loc);
256
253
  }
257
254
  static visit(node, visitNode) {
258
255
  visitNode(node.declaration);
259
256
  }
257
+ constructor(declaration, range, loc) {
258
+ super(range, loc);
259
+ this.declaration = declaration;
260
+ }
260
261
  getDeclaration() {
261
262
  return this.declaration;
262
263
  }
@@ -285,27 +286,27 @@ let ExportDefaultDeclaration = ExportDefaultDeclaration_1 = class ExportDefaultD
285
286
  };
286
287
  ExportDefaultDeclaration = ExportDefaultDeclaration_1 = __decorate([
287
288
  Deserializer('ExportDefaultDeclaration'),
288
- __metadata("design:paramtypes", [Object])
289
+ __metadata("design:paramtypes", [Object, Array, Object])
289
290
  ], ExportDefaultDeclaration);
290
291
  export { ExportDefaultDeclaration };
291
292
  /**
292
293
  * An export batch declaration, e.g., `export * from "mod";`.
293
294
  */
294
295
  let ExportAllDeclaration = ExportAllDeclaration_1 = class ExportAllDeclaration extends AbstractExpressionNode {
295
- constructor(source, exported, assertions) {
296
- super();
297
- this.source = source;
298
- this.exported = exported;
299
- this.assertions = assertions;
300
- }
301
296
  static fromJSON(node, deserializer) {
302
- return new ExportAllDeclaration_1(deserializer(node.source), node.exported ? deserializer(node.exported) : void 0, node.assertions?.map(deserializer));
297
+ return new ExportAllDeclaration_1(deserializer(node.source), node.exported ? deserializer(node.exported) : void 0, node.assertions?.map(deserializer), node.range, node.loc);
303
298
  }
304
299
  static visit(node, visitNode) {
305
300
  visitNode(node.source);
306
301
  node.exported && visitNode(node.exported);
307
302
  node.assertions?.forEach(visitNode);
308
303
  }
304
+ constructor(source, exported, assertions, range, loc) {
305
+ super(range, loc);
306
+ this.source = source;
307
+ this.exported = exported;
308
+ this.assertions = assertions;
309
+ }
309
310
  getSource() {
310
311
  return this.source;
311
312
  }
@@ -367,7 +368,7 @@ let ExportAllDeclaration = ExportAllDeclaration_1 = class ExportAllDeclaration e
367
368
  ExportAllDeclaration = ExportAllDeclaration_1 = __decorate([
368
369
  Deserializer('ExportAllDeclaration'),
369
370
  __metadata("design:paramtypes", [Literal,
370
- Identifier, Array])
371
+ Identifier, Array, Array, Object])
371
372
  ], ExportAllDeclaration);
372
373
  export { ExportAllDeclaration };
373
374
  //# sourceMappingURL=export.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/expressions/api/module/export.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAMH,OAAO,EAAiB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,UAA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K,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,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"]}
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,CAAC;AAC9D,OAAO,EAAmB,eAAe,EAAE,MAAM,aAAa,CAAC;AAK/D;;;;;;;;;;;;;GAaG;AAEI,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,eAAe;IACnD,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,EACzC,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,GAAG,CACR,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;IACD,YACC,K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O,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;AAnFY,oBAAoB;IADhC,YAAY,CAAC,sBAAsB,CAAC;qCAiBnB,OAAO;QACJ,UAAU;GAjBlB,oBAAoB,CAmFhC;SAnFY,oBAAoB","sourcesContent":["\n/**\n * There are two types of exports:\n * 1- Named Exports (Zero or more exports per module)\n * 2- Default Exports (One per module)\n * \n * // Exporting individual features\n * export let name1, name2, …, nameN; // also var, const\n * export let name1 = …, name2 = …, …, nameN; // also var, const\n * export function functionName(){...}\n * export class ClassName {...}\n * \n * // Export list\n * export { name1, name2, …, nameN };\n * \n * // Renaming exports\n * export { variable1 as name1, variable2 as name2, …, nameN };\n * \n * // Exporting destructed assignments with renaming\n * export const { name1, name2: bar } = o;\n * \n * // Default exports\n * export default expression;\n * export default function (…) { … } // also class, function*\n * export default function name1(…) { … } // also class, function*\n * export { name1 as default, … };\n * \n * // Aggregating modules\n * export * from …; // does not set the default export\n * export * as name1 from …; // Draft ECMAScript® 2O21\n * export { name1, name2, …, nameN } from …;\n * export { import1 as name1, import2 as name2, …, nameN } from …;\n * export { default, … } from …;\n */\n\nimport type {\n\tNodeDeserializer, ExpressionNode, ExpressionEventPath,\n\tVisitNodeType, DeclarationExpression, SourceLocation\n} from '../expression.js';\nimport { ModuleContext, ReactiveScope } from '../../scope/scope.js';\nimport { Stack } from '../../scope/stack.js';\nimport { AbstractExpressionNode } from '../abstract.js';\nimport { Deserializer } from '../deserialize/deserialize.js';\nimport { Identifier, Literal } from '../definition/values.js';\nimport { ImportAttribute, ModuleSpecifier } from './common.js';\nimport { FunctionDeclaration } from '../definition/function.js';\nimport { ClassDeclaration } from '../class/class.js';\n\n\n/**\n * An exported variable binding, e.g., `{foo}` in `export {foo}` or `{bar as foo}` in `export {bar as foo}`.\n * \n * The `exported` field refers to the name exported in the module.\n * \n * The `local` field refers to the binding into the local module scope.\n * \n * If it is a basic named export, such as in `export {foo}`, both `exported` and `local` are equivalent `Identifier` nodes;\n * in this case an Identifier node representing `foo`.\n * \n * If it is an aliased export,\n * such as in `export {bar as foo}`, the `exported` field is an `Identifier` node representing `foo`,\n * and the `local` field is an `Identifier` node representing `bar`.\n */\n@Deserializer('ExportSpecifier')\nexport class ExportSpecifier extends ModuleSpecifier {\n\tstatic fromJSON(node: ExportSpecifier, deserializer: NodeDeserializer): ExportSpecifier {\n\t\treturn new ExportSpecifier(\n\t\t\tdeserializer(node.local) as Identifier,\n\t\t\tdeserializer(node.exported) as Identifier,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportSpecifier, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.local);\n\t\tvisitNode(node.exported);\n\t}\n\tconstructor(\n\t\tlocal: Identifier,\n\t\tprivate exported: Identifier,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(local, range, loc);\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tset(stack: Stack, value: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tget(stack: Stack, thisContext?: any) {\n\t\tthrow new Error('Method not implemented.');\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString(): string {\n\t\tconst local = this.local.toString();\n\t\tconst exported = this.exported.toString();\n\t\tif (local == exported) {\n\t\t\treturn local;\n\t\t}\n\t\treturn `${local} as ${exported}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tlocal: this.local.toJSON(),\n\t\t\texported: this.exported.toJSON()\n\t\t};\n\t}\n}\n\n\n/**\n * An export named declaration, e.g.,\n * `export {foo, bar};`,\n * `export {foo} from \"mod\";`\n * or `export var foo = 1;`.\n * \n * Note: Having `declaration` populated with non-empty `specifiers` or non-null `source` results in an invalid state.\n */\n@Deserializer('ExportNamedDeclaration')\nexport class ExportNamedDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportNamedDeclaration, deserializer: NodeDeserializer): ExportNamedDeclaration {\n\t\treturn new ExportNamedDeclaration(\n\t\t\tnode.specifiers.map(deserializer) as ExportSpecifier[],\n\t\t\tnode.declaration ? deserializer(node.declaration) as DeclarationExpression : void 0,\n\t\t\tnode.source ? deserializer(node.source) as Literal<string> : void 0,\n\t\t\tnode.assertions ? node.assertions.map(deserializer) as ImportAttribute[] : void 0,\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportNamedDeclaration, visitNode: VisitNodeType): void {\n\t\tnode.specifiers.map(visitNode);\n\t\tnode.source && visitNode(node.source);\n\t\tnode.declaration && visitNode(node.declaration);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate specifiers: ExportSpecifier[],\n\t\tprivate declaration?: DeclarationExpression,\n\t\tprivate source?: Literal<string>,\n\t\tprivate assertions?: ImportAttribute[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetSpecifiers() {\n\t\treturn this.specifiers;\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportNamedDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tif (this.declaration) {\n\t\t\tthis.exportDeclaration(stack);\n\t\t}\n\t\telse if (this.source) {\n\t\t\tthis.exportFromSource(stack);\n\t\t} else {\n\t\t\tthis.exportLocal(stack);\n\t\t}\n\t}\n\n\tprivate exportDeclaration(stack: Stack) {\n\t\tif (!this.declaration) {\n\t\t\treturn\n\t\t}\n\t\tthis.declaration.get(stack);\n\t\tconst declaredName = this.declaration.getDeclarationName?.();\n\t\tif (!declaredName) {\n\t\t\tthrow new Error(`Name is not defined for ${this.declaration.toString()}`);\n\t\t}\n\t\tconst value = stack.get(declaredName);\n\t\tstack.getModule()!.set(declaredName, value);\n\t}\n\tprivate exportFromSource(stack: Stack) {\n\t\tif (!this.source) {\n\t\t\treturn;\n\t\t}\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.assertions) {\n\t\t\tconst importAssertions: ImportAssertions = this.assertions\n\t\t\t\t.map(assertion => assertion.get(stack))\n\t\t\t\t.reduce((p, c) => Object.assign(p, c), {});\n\t\t\tif (importAssertions) {\n\t\t\t\timportCallOptions = { assert: importAssertions };\n\t\t\t}\n\t\t}\n\t\tconst sourceModule = stack.importModule(this.source.get(), importCallOptions);\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = sourceModule.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tprivate exportLocal(stack: Stack, importCallOptions?: ImportCallOptions) {\n\t\tconst localModule = stack.getModule()!;\n\t\tthis.specifiers.forEach(specifier => {\n\t\t\tconst localName = specifier.getLocal().get(stack);\n\t\t\tconst exportedName = specifier.getExported().get(stack);\n\t\t\tconst localValue = stack.get(localName);\n\t\t\tlocalModule.set(exportedName, localValue);\n\t\t\tconst scope = stack.findScope(localName);\n\t\t\tif (scope instanceof ReactiveScope) {\n\t\t\t\tconst scopeSubscription = scope.subscribe(localName, (newLocalValue, oldLocalValue) => {\n\t\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\t\tlocalModule.set(exportedName, newLocalValue);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t\t}\n\t\t});\n\t}\n\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tif (this.declaration) {\n\t\t\tconst declaration = this.declaration.toString();\n\t\t\treturn `export ${declaration}`;\n\t\t}\n\t\tconst specifiers = this.specifiers.map(specifier => specifier.toString()).join(',');\n\t\tlet exportStr = `export {${specifiers}}`;\n\t\tif (!this.source) {\n\t\t\treturn `${exportStr};`;\n\t\t}\n\t\tconst source = this.source.toString();\n\t\treturn `${exportStr} from ${source}${this.assertions ? ` assert { ${this.assertions.map(assertion => assertion.toString()).join(', ')} }` : ''};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tspecifiers: this.specifiers.map(specifier => specifier.toJSON()),\n\t\t\tsource: this.source?.toJSON(),\n\t\t\tdeclaration: this.declaration?.toJSON(),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n\n\n/**\n * An export default declaration, e.g., \n * `export default function () {};`\n * or `export default 1;`.\n */\n@Deserializer('ExportDefaultDeclaration')\nexport class ExportDefaultDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportDefaultDeclaration, deserializer: NodeDeserializer): ExportDefaultDeclaration {\n\t\treturn new ExportDefaultDeclaration(\n\t\t\tdeserializer(node.declaration),\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportDefaultDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.declaration);\n\t}\n\tconstructor(\n\t\tprivate declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode,\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetDeclaration() {\n\t\treturn this.declaration;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tconst declaration = this.declaration.get(stack);\n\t\tstack.getModule()!.set('default', declaration);\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\tconst declaration = this.declaration.toString();\n\t\treturn `export default ${declaration}`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tdeclaration: this.declaration.toJSON(),\n\t\t};\n\t}\n}\n\n/**\n * An export batch declaration, e.g., `export * from \"mod\";`.\n */\n@Deserializer('ExportAllDeclaration')\nexport class ExportAllDeclaration extends AbstractExpressionNode {\n\tstatic fromJSON(node: ExportAllDeclaration, deserializer: NodeDeserializer): ExportAllDeclaration {\n\t\treturn new ExportAllDeclaration(\n\t\t\tdeserializer(node.source) as Literal<string>,\n\t\t\tnode.exported ? deserializer(node.exported) as Identifier : void 0,\n\t\t\tnode.assertions?.map(deserializer) as ImportAttribute[],\n\t\t\tnode.range,\n\t\t\tnode.loc\n\t\t);\n\t}\n\tstatic visit(node: ExportAllDeclaration, visitNode: VisitNodeType): void {\n\t\tvisitNode(node.source);\n\t\tnode.exported && visitNode(node.exported);\n\t\tnode.assertions?.forEach(visitNode);\n\t}\n\tconstructor(\n\t\tprivate source: Literal<string>,\n\t\tprivate exported?: Identifier,\n\t\tprivate assertions?: ImportAttribute[],\n\t\trange?: [number, number],\n\t\tloc?: SourceLocation) {\n\t\tsuper(range, loc);\n\t}\n\tgetSource() {\n\t\treturn this.source;\n\t}\n\tgetExported() {\n\t\treturn this.exported;\n\t}\n\tgetAssertions() {\n\t\treturn this.assertions;\n\t}\n\tset(stack: Stack) {\n\t\tthrow new Error(`ExportDefaultDeclaration.#set() has no implementation.`);\n\t}\n\tget(stack: Stack) {\n\t\tlet importCallOptions: ImportCallOptions | undefined;\n\t\tif (this.assertions) {\n\t\t\tconst importAssertions: ImportAssertions = this.assertions\n\t\t\t\t.map(assertion => assertion.get(stack))\n\t\t\t\t.reduce((p, c) => Object.assign(p, c), {});\n\t\t\tif (importAssertions) {\n\t\t\t\timportCallOptions = { assert: importAssertions };\n\t\t\t}\n\t\t}\n\t\tlet localModule: ReactiveScope<ModuleContext> = stack.getModule()!;\n\t\tconst sourceModule = stack.importModule(this.source.get(), importCallOptions);\n\n\t\tif (this.exported) {\n\t\t\tconst exportedName = this.exported.get(stack);\n\t\t\tlocalModule.set(exportedName, {});\n\t\t\tlocalModule = localModule.getInnerScope(exportedName)!;\n\t\t}\n\n\t\tconst properties = Object.keys(sourceModule.getContext()) as (keyof ModuleContext)[];\n\t\tproperties.forEach(property => {\n\n\t\t\tconst localValue = sourceModule.get(property);\n\t\t\tlocalModule.set(property, localValue);\n\t\t\tconst scopeSubscription = sourceModule.subscribe(property, (newLocalValue, oldLocalValue) => {\n\t\t\t\tif (newLocalValue !== oldLocalValue) {\n\t\t\t\t\tlocalModule.set(property, newLocalValue);\n\t\t\t\t}\n\t\t\t});\n\t\t\tstack.onDestroy(() => scopeSubscription.unsubscribe());\n\t\t});\n\t}\n\tdependency(computed?: true): ExpressionNode[] {\n\t\treturn [];\n\t}\n\tdependencyPath(computed?: true): ExpressionEventPath[] {\n\t\treturn [];\n\t}\n\ttoString() {\n\t\treturn `export *${this.exported ? ` as ${this.exported.toString()}` : ''} from ${this.source.toString()}${this.assertions ? ` assert { ${this.assertions.map(assertion => assertion.toString()).join(', ')} }` : ''};`;\n\t}\n\ttoJson(): object {\n\t\treturn {\n\t\t\tsource: this.source.toJSON(),\n\t\t\texported: this.exported?.toJSON(),\n\t\t\tassertions: this.assertions?.map(assertion => assertion.toJSON()),\n\t\t};\n\t}\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType } from '../expression.js';
1
+ import type { NodeDeserializer, ExpressionNode, ExpressionEventPath, VisitNodeType, SourceLocation } from '../expression.js';
2
2
  import type { ModuleScope } from '../../scope/scope.js';
3
3
  import type { Stack } from '../../scope/stack.js';
4
4
  import { AbstractExpressionNode } from '../abstract.js';
@@ -25,7 +25,7 @@ export declare class ImportSpecifier extends ModuleSpecifier {
25
25
  private imported;
26
26
  static fromJSON(node: ImportSpecifier, deserializer: NodeDeserializer): ImportSpecifier;
27
27
  static visit(node: ImportSpecifier, visitNode: VisitNodeType): void;
28
- constructor(local: Identifier, imported: Identifier);
28
+ constructor(local: Identifier, imported: Identifier, range?: [number, number], loc?: SourceLocation);
29
29
  getImported(): Identifier;
30
30
  getImportedName(): string | number;
31
31
  set(stack: Stack, value: any): void;
@@ -89,7 +89,7 @@ export declare class ImportDeclaration extends AbstractExpressionNode {
89
89
  private assertions?;
90
90
  static fromJSON(node: ImportDeclaration, deserializer: NodeDeserializer): ImportDeclaration;
91
91
  static visit(node: ImportDeclaration, visitNode: VisitNodeType): void;
92
- constructor(source: Literal<string>, specifiers?: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[] | undefined, assertions?: ImportAttribute[] | undefined);
92
+ constructor(source: Literal<string>, specifiers?: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[] | undefined, assertions?: ImportAttribute[] | undefined, range?: [number, number], loc?: SourceLocation);
93
93
  getSource(): Literal<string>;
94
94
  getSpecifiers(): (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[] | undefined;
95
95
  getAssertions(): ImportAttribute[] | undefined;
@@ -111,7 +111,7 @@ export declare class ImportExpression extends AbstractExpressionNode {
111
111
  private attributes?;
112
112
  static fromJSON(node: ImportExpression, deserializer: NodeDeserializer): ImportExpression;
113
113
  static visit(node: ImportExpression, visitNode: VisitNodeType): void;
114
- constructor(source: Literal<string>, attributes?: ExpressionNode | undefined);
114
+ constructor(source: Literal<string>, attributes?: ExpressionNode | undefined, range?: [number, number], loc?: SourceLocation);
115
115
  getSource(): Literal<string>;
116
116
  set(stack: Stack): void;
117
117
  get(stack: Stack): Promise<ModuleScope>;