@ibyar/expressions 0.8.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -1
- package/api/abstract.d.ts +1 -0
- package/api/abstract.d.ts.map +1 -0
- package/api/abstract.js +12 -0
- package/api/abstract.js.map +1 -1
- package/api/class/class.d.ts +1 -0
- package/api/class/class.d.ts.map +1 -0
- package/api/class/class.js +603 -472
- package/api/class/class.js.map +1 -1
- package/api/class/decorator.d.ts +1 -0
- package/api/class/decorator.d.ts.map +1 -0
- package/api/class/decorator.js +53 -41
- package/api/class/decorator.js.map +1 -1
- package/api/computing/call.d.ts +1 -0
- package/api/computing/call.d.ts.map +1 -0
- package/api/computing/call.js +83 -69
- package/api/computing/call.js.map +1 -1
- package/api/computing/debugger.d.ts +1 -0
- package/api/computing/debugger.d.ts.map +1 -0
- package/api/computing/debugger.js +40 -28
- package/api/computing/debugger.js.map +1 -1
- package/api/computing/new.d.ts +1 -0
- package/api/computing/new.d.ts.map +1 -0
- package/api/computing/new.js +81 -68
- package/api/computing/new.js.map +1 -1
- package/api/computing/rest.d.ts +1 -0
- package/api/computing/rest.d.ts.map +1 -0
- package/api/computing/rest.js +54 -42
- package/api/computing/rest.js.map +1 -1
- package/api/computing/return.d.ts +1 -0
- package/api/computing/return.d.ts.map +1 -0
- package/api/computing/return.js +52 -40
- package/api/computing/return.js.map +1 -1
- package/api/computing/spread.d.ts +1 -0
- package/api/computing/spread.d.ts.map +1 -0
- package/api/computing/spread.js +70 -58
- package/api/computing/spread.js.map +1 -1
- package/api/computing/throw.d.ts +1 -0
- package/api/computing/throw.d.ts.map +1 -0
- package/api/computing/throw.js +216 -175
- package/api/computing/throw.js.map +1 -1
- package/api/computing/yield.d.ts +1 -0
- package/api/computing/yield.d.ts.map +1 -0
- package/api/computing/yield.js +60 -47
- package/api/computing/yield.js.map +1 -1
- package/api/definition/array.d.ts +1 -0
- package/api/definition/array.d.ts.map +1 -0
- package/api/definition/array.js +147 -122
- package/api/definition/array.js.map +1 -1
- package/api/definition/bind.d.ts +1 -0
- package/api/definition/bind.d.ts.map +1 -0
- package/api/definition/bind.js +85 -70
- package/api/definition/bind.js.map +1 -1
- package/api/definition/comment.d.ts +1 -0
- package/api/definition/comment.d.ts.map +1 -0
- package/api/definition/comment.js +44 -32
- package/api/definition/comment.js.map +1 -1
- package/api/definition/function.d.ts +1 -0
- package/api/definition/function.d.ts.map +1 -0
- package/api/definition/function.js +500 -443
- package/api/definition/function.js.map +1 -1
- package/api/definition/member.d.ts +1 -0
- package/api/definition/member.d.ts.map +1 -0
- package/api/definition/member.js +104 -89
- package/api/definition/member.js.map +1 -1
- package/api/definition/object.d.ts +1 -0
- package/api/definition/object.d.ts.map +1 -0
- package/api/definition/object.js +243 -200
- package/api/definition/object.js.map +1 -1
- package/api/definition/statement.d.ts +1 -0
- package/api/definition/statement.d.ts.map +1 -0
- package/api/definition/statement.js +56 -44
- package/api/definition/statement.js.map +1 -1
- package/api/definition/values.d.ts +1 -0
- package/api/definition/values.d.ts.map +1 -0
- package/api/definition/values.js +228 -160
- package/api/definition/values.js.map +1 -1
- package/api/deserialize/deserialize.d.ts +2 -1
- package/api/deserialize/deserialize.d.ts.map +1 -0
- package/api/deserialize/deserialize.js +5 -7
- package/api/deserialize/deserialize.js.map +1 -1
- package/api/deserialize/type-store.d.ts +1 -0
- package/api/deserialize/type-store.d.ts.map +1 -0
- package/api/expression.d.ts +1 -0
- package/api/expression.d.ts.map +1 -0
- package/api/index.d.ts +1 -0
- package/api/index.d.ts.map +1 -0
- package/api/module/common.d.ts +1 -0
- package/api/module/common.d.ts.map +1 -0
- package/api/module/common.js +63 -50
- package/api/module/common.js.map +1 -1
- package/api/module/export.d.ts +1 -0
- package/api/module/export.d.ts.map +1 -0
- package/api/module/export.js +343 -290
- package/api/module/export.js.map +1 -1
- package/api/module/import.d.ts +1 -0
- package/api/module/import.d.ts.map +1 -0
- package/api/module/import.js +318 -253
- package/api/module/import.js.map +1 -1
- package/api/operators/assignment.d.ts +1 -0
- package/api/operators/assignment.d.ts.map +1 -0
- package/api/operators/assignment.js +88 -75
- package/api/operators/assignment.js.map +1 -1
- package/api/operators/await.d.ts +1 -0
- package/api/operators/await.d.ts.map +1 -0
- package/api/operators/await.js +54 -42
- package/api/operators/await.js.map +1 -1
- package/api/operators/binary.d.ts +1 -0
- package/api/operators/binary.d.ts.map +1 -0
- package/api/operators/binary.js +78 -64
- package/api/operators/binary.js.map +1 -1
- package/api/operators/chaining.d.ts +1 -0
- package/api/operators/chaining.d.ts.map +1 -0
- package/api/operators/chaining.js +56 -44
- package/api/operators/chaining.js.map +1 -1
- package/api/operators/comma.d.ts +1 -0
- package/api/operators/comma.d.ts.map +1 -0
- package/api/operators/comma.js +53 -41
- package/api/operators/comma.js.map +1 -1
- package/api/operators/grouping.d.ts +1 -0
- package/api/operators/grouping.d.ts.map +1 -0
- package/api/operators/grouping.js +51 -39
- package/api/operators/grouping.js.map +1 -1
- package/api/operators/logical.d.ts +1 -0
- package/api/operators/logical.d.ts.map +1 -0
- package/api/operators/logical.js +51 -37
- package/api/operators/logical.js.map +1 -1
- package/api/operators/pipeline.d.ts +1 -0
- package/api/operators/pipeline.d.ts.map +1 -0
- package/api/operators/pipeline.js +95 -81
- package/api/operators/pipeline.js.map +1 -1
- package/api/operators/ternary.d.ts +1 -0
- package/api/operators/ternary.d.ts.map +1 -0
- package/api/operators/ternary.js +69 -55
- package/api/operators/ternary.js.map +1 -1
- package/api/operators/types.d.ts +1 -0
- package/api/operators/types.d.ts.map +1 -0
- package/api/operators/unary.d.ts +1 -0
- package/api/operators/unary.d.ts.map +1 -0
- package/api/operators/unary.js +97 -82
- package/api/operators/unary.js.map +1 -1
- package/api/operators/update.d.ts +1 -0
- package/api/operators/update.d.ts.map +1 -0
- package/api/operators/update.js +78 -62
- package/api/operators/update.js.map +1 -1
- package/api/program.d.ts +1 -0
- package/api/program.d.ts.map +1 -0
- package/api/program.js +53 -40
- package/api/program.js.map +1 -1
- package/api/statement/control/block.d.ts +1 -0
- package/api/statement/control/block.d.ts.map +1 -0
- package/api/statement/control/block.js +65 -53
- package/api/statement/control/block.js.map +1 -1
- package/api/statement/control/empty.d.ts +1 -1
- package/api/statement/control/empty.d.ts.map +1 -0
- package/api/statement/control/empty.js +43 -33
- package/api/statement/control/empty.js.map +1 -1
- package/api/statement/control/if.d.ts +1 -0
- package/api/statement/control/if.d.ts.map +1 -0
- package/api/statement/control/if.js +79 -65
- package/api/statement/control/if.js.map +1 -1
- package/api/statement/control/switch.d.ts +1 -0
- package/api/statement/control/switch.d.ts.map +1 -0
- package/api/statement/control/switch.js +180 -141
- package/api/statement/control/switch.js.map +1 -1
- package/api/statement/control/terminate.d.ts +1 -2
- package/api/statement/control/terminate.d.ts.map +1 -0
- package/api/statement/control/terminate.js +117 -78
- package/api/statement/control/terminate.js.map +1 -1
- package/api/statement/control/with.d.ts +1 -0
- package/api/statement/control/with.d.ts.map +1 -0
- package/api/statement/control/with.js +72 -59
- package/api/statement/control/with.js.map +1 -1
- package/api/statement/declarations/declares.d.ts +1 -0
- package/api/statement/declarations/declares.d.ts.map +1 -0
- package/api/statement/declarations/declares.js +148 -121
- package/api/statement/declarations/declares.js.map +1 -1
- package/api/statement/iterations/for.d.ts +1 -0
- package/api/statement/iterations/for.d.ts.map +1 -0
- package/api/statement/iterations/for.js +337 -277
- package/api/statement/iterations/for.js.map +1 -1
- package/api/statement/iterations/while.d.ts +1 -0
- package/api/statement/iterations/while.d.ts.map +1 -0
- package/api/statement/iterations/while.js +152 -125
- package/api/statement/iterations/while.js.map +1 -1
- package/api/utils.d.ts +1 -0
- package/api/utils.d.ts.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -0
- package/package.json +5 -5
- package/scope/builder.d.ts +27 -0
- package/scope/builder.d.ts.map +1 -0
- package/scope/builder.js +73 -0
- package/scope/builder.js.map +1 -0
- package/scope/event.d.ts +1 -0
- package/scope/event.d.ts.map +1 -0
- package/scope/finalizer.d.ts +1 -0
- package/scope/finalizer.d.ts.map +1 -0
- package/scope/index.d.ts +1 -0
- package/scope/index.d.ts.map +1 -0
- package/scope/pool.d.ts +1 -0
- package/scope/pool.d.ts.map +1 -0
- package/scope/proxy.d.ts +1 -0
- package/scope/proxy.d.ts.map +1 -0
- package/scope/proxy.js +1 -0
- package/scope/proxy.js.map +1 -1
- package/scope/scope.d.ts +1 -0
- package/scope/scope.d.ts.map +1 -0
- package/scope/scope.js +17 -11
- package/scope/scope.js.map +1 -1
- package/scope/stack.d.ts +1 -0
- package/scope/stack.d.ts.map +1 -0
- package/scope/stack.js +22 -14
- package/scope/stack.js.map +1 -1
- package/v8/enums.d.ts +1 -0
- package/v8/enums.d.ts.map +1 -0
- package/v8/enums.js +11 -11
- package/v8/enums.js.map +1 -1
- package/v8/factory.d.ts +1 -0
- package/v8/factory.d.ts.map +1 -0
- package/v8/factory.js +3 -1
- package/v8/factory.js.map +1 -1
- package/v8/index.d.ts +1 -0
- package/v8/index.d.ts.map +1 -0
- package/v8/inline.d.ts +1 -0
- package/v8/inline.d.ts.map +1 -0
- package/v8/inline.js +9 -5
- package/v8/inline.js.map +1 -1
- package/v8/language.d.ts +1 -0
- package/v8/language.d.ts.map +1 -0
- package/v8/node.d.ts +1 -0
- package/v8/node.d.ts.map +1 -0
- package/v8/parser.d.ts +1 -0
- package/v8/parser.d.ts.map +1 -0
- package/v8/parser.js +5 -5
- package/v8/parser.js.map +1 -1
- package/v8/stream.d.ts +1 -0
- package/v8/stream.d.ts.map +1 -0
- package/v8/stream.js +17 -7
- package/v8/stream.js.map +1 -1
- package/v8/token.d.ts +1 -0
- package/v8/token.d.ts.map +1 -0
- package/v8/token.js +363 -358
- package/v8/token.js.map +1 -1
- package/visit/index.d.ts +1 -0
- package/visit/index.d.ts.map +1 -0
- package/visit/visitor.d.ts +1 -0
- package/visit/visitor.d.ts.map +1 -0
- package/v8/nodes.d.ts +0 -0
- package/v8/nodes.js +0 -2
- package/v8/nodes.js.map +0 -1
package/scope/event.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ import { ReactiveScope, Scope, Context } from './scope.js';
|
|
|
3
3
|
import { Stack } from './stack.js';
|
|
4
4
|
export declare function findScopeByEventMap(events: ExpressionEventMap, stack: Stack): [string, Scope<Context>][];
|
|
5
5
|
export declare function findReactiveScopeByEventMap(events: ExpressionEventMap, stack: Stack): [string, ReactiveScope<Context>][];
|
|
6
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAiBnC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAcxG;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,CAGxH"}
|
package/scope/finalizer.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalizer.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/finalizer.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;AAM9B,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAElG;AAGD,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAEjE"}
|
package/scope/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/scope/pool.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare function getScopeFor<T extends object>(ctx: T, type: 'scope', pro
|
|
|
5
5
|
export declare function getScopeFor<T extends object>(ctx: T, type: 'read-only', propertyKeys?: (keyof T)[]): ReadOnlyScope<T>;
|
|
6
6
|
export declare function getScopeFor<T extends object>(ctx: T, type: 'reactive', propertyKeys?: (keyof T)[]): ReactiveScope<T>;
|
|
7
7
|
export declare function getScopeFor<T extends object>(ctx: T, type: 'reactive-control', propertyKeys?: (keyof T)[]): ReactiveScopeControl<T>;
|
|
8
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAIvF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAEhF,wBAAgB,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;AACzF,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3G,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AACvH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AACtH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC"}
|
package/scope/proxy.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export type RevocableProxy<T> = {
|
|
|
17
17
|
};
|
|
18
18
|
export declare function createRevocableProxyForContext<T extends object>(context: T, scope: Scope<T>): RevocableProxy<T>;
|
|
19
19
|
export declare function createProxyForContext<T extends object>(scope: Scope<T>): T;
|
|
20
|
+
//# sourceMappingURL=proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,WAevC;AAED;;GAEG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,OAAO,CAAE,YAAW,YAAY,CAAC,OAAO,CAAC;IAErE,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACnC,GAAG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SACb;QACD,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IACD,GAAG,CAAC,KAAQ,EAAE,WAAwB,EAAE,KAAU,EAAE,QAAa;QAChE,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,cAAc,CAAC,KAAQ,EAAE,WAA4B;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;CACD;AAOD,MAAM,UAAU,8BAA8B,CAAmB,OAAU,EAAE,KAAe;IAC3F,OAAO,KAAK,CAAC,SAAS,CAAI,OAAO,EAAE,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAmB,KAAe;IACtE,OAAO,IAAI,KAAK,CAAI,KAAK,CAAC,UAAU,EAAE,EAAE,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import type { Scope, Context } from './scope.js';\n\nexport function hasBindingHook<T>(ctx: T) {\n\tswitch (true) {\n\t\t// exclude classes that have binding hook\n\t\tcase ctx instanceof Map:\n\t\tcase ctx instanceof Set:\n\t\tcase ctx instanceof Date:\n\t\tcase ctx instanceof WeakMap:\n\t\tcase ctx instanceof WeakSet:\n\t\tcase ctx instanceof Promise:\n\t\t// check first if running in browser\n\t\tcase HTMLElement && ctx instanceof HTMLElement:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\n/**\n * crete new proxy handler object as scoped context\n */\nexport class ScopeProxyHandler<T extends Context> implements ProxyHandler<Context> {\n\t// private functionHandler: FunctionProxyHandler<Function>;\n\tconstructor(private scope: Scope<T>) { }\n\thas(model: T, propertyKey: PropertyKey): boolean {\n\t\treturn this.scope.has(propertyKey);\n\t}\n\tget(model: T, propertyKey: PropertyKey, receiver: any): any {\n\t\tconst value = this.scope.get(propertyKey);\n\t\tif (!(value && typeof value === 'object')) {\n\t\t\treturn value;\n\t\t}\n\t\tconst scope = this.scope.getInnerScope(propertyKey);\n\t\tif (!scope) {\n\t\t\treturn value;\n\t\t}\n\t\treturn createProxyForContext(scope);\n\t}\n\tset(model: T, propertyKey: PropertyKey, value: any, receiver: any): boolean {\n\t\treturn this.scope.set(propertyKey, value);\n\t}\n\tdeleteProperty(model: T, propertyKey: string | symbol): boolean {\n\t\treturn this.scope.delete(propertyKey);\n\t}\n}\n\nexport type RevocableProxy<T> = {\n\tproxy: T;\n\trevoke: () => void;\n};\n\nexport function createRevocableProxyForContext<T extends object>(context: T, scope: Scope<T>): RevocableProxy<T> {\n\treturn Proxy.revocable<T>(context, new ScopeProxyHandler(scope));\n}\n\nexport function createProxyForContext<T extends object>(scope: Scope<T>): T {\n\treturn new Proxy<T>(scope.getContext(), new ScopeProxyHandler(scope));\n}\n"]}
|
package/scope/scope.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,KAAK,CAAC,CAAC,GAAG,OAAO;IAEjC;;;OAGG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC;IAE/B;;;;;OAKG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC;IAEhE;;;OAGG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAEnC;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,OAA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AI,EAAE,UAAU,CAAA;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC7C,MAAM,EAAE,YAAY,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;CACxD;AAED,qBAAa,WAAY,SAAQ,aAAa,CAAC,aAAa,CAAC;gBAChD,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC,MAAM,aAAa,CAAC,EAAE;IAG1E,YAAY,CAAC,WAAW,EAAE,MAAM,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI;CAKxE;AACD,qBAAa,cAAe,SAAQ,WAAW;IAIlC,OAAO,CAAC,MAAM;IAAU,OAAO,CAAC,iBAAiB,CAAC;IAD9D,OAAO,CAAC,MAAM,CAAe;gBACT,MAAM,EAAE,MAAM,EAAU,iBAAiB,CAAC,+BAAmB;IAOjF,OAAO,CAAC,aAAa;IAKrB,aAAa;CAGb"}
|
package/scope/scope.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
export class Scope {
|
|
2
|
+
_ctx;
|
|
3
|
+
_keys;
|
|
2
4
|
static for(ctx, propertyKeys) {
|
|
3
5
|
return new Scope(ctx, propertyKeys);
|
|
4
6
|
}
|
|
5
7
|
static blockScope(propertyKeys) {
|
|
6
8
|
return new Scope({}, propertyKeys);
|
|
7
9
|
}
|
|
10
|
+
_inners = new Map();
|
|
8
11
|
constructor(_ctx, _keys) {
|
|
9
12
|
this._ctx = _ctx;
|
|
10
13
|
this._keys = _keys;
|
|
11
|
-
this._inners = new Map();
|
|
12
14
|
}
|
|
13
15
|
get(key) {
|
|
14
16
|
return Reflect.get(this._ctx, key);
|
|
@@ -73,6 +75,8 @@ export class ReadOnlyScope extends Scope {
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
export class ScopeSubscription {
|
|
78
|
+
propertyKey;
|
|
79
|
+
observer;
|
|
76
80
|
constructor(propertyKey, observer) {
|
|
77
81
|
this.propertyKey = propertyKey;
|
|
78
82
|
this.observer = observer;
|
|
@@ -88,10 +92,8 @@ export class ScopeSubscription {
|
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
export class ValueChangeObserver {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this._lock = [];
|
|
94
|
-
}
|
|
95
|
+
_subscribers = new Map();
|
|
96
|
+
_lock = [];
|
|
95
97
|
emit(propertyKey, newValue, oldValue) {
|
|
96
98
|
if (this._lock.includes(propertyKey)) {
|
|
97
99
|
return;
|
|
@@ -157,6 +159,8 @@ export class ValueChangeObserver {
|
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
export class ReactiveScope extends Scope {
|
|
162
|
+
_name;
|
|
163
|
+
_parent;
|
|
160
164
|
static for(context, propertyKeys) {
|
|
161
165
|
return new ReactiveScope(context, propertyKeys);
|
|
162
166
|
}
|
|
@@ -181,11 +185,12 @@ export class ReactiveScope extends Scope {
|
|
|
181
185
|
rootScope.setInnerScope('this', thisScope);
|
|
182
186
|
return rootScope;
|
|
183
187
|
}
|
|
188
|
+
_clone;
|
|
189
|
+
_observer = new ValueChangeObserver();
|
|
184
190
|
constructor(context, propertyKeys, _name, _parent) {
|
|
185
191
|
super(context, propertyKeys);
|
|
186
192
|
this._name = _name;
|
|
187
193
|
this._parent = _parent;
|
|
188
|
-
this._observer = new ValueChangeObserver();
|
|
189
194
|
this._clone = Object.assign({}, context);
|
|
190
195
|
}
|
|
191
196
|
set(propertyKey, newValue, receiver) {
|
|
@@ -276,11 +281,6 @@ export class ReactiveScope extends Scope {
|
|
|
276
281
|
}
|
|
277
282
|
}
|
|
278
283
|
export class ReactiveScopeControl extends ReactiveScope {
|
|
279
|
-
constructor() {
|
|
280
|
-
super(...arguments);
|
|
281
|
-
this._attached = true;
|
|
282
|
-
this._marked = {};
|
|
283
|
-
}
|
|
284
284
|
static for(context, propertyKeys) {
|
|
285
285
|
return new ReactiveScopeControl(context, propertyKeys);
|
|
286
286
|
}
|
|
@@ -314,6 +314,8 @@ export class ReactiveScopeControl extends ReactiveScope {
|
|
|
314
314
|
rootScope.setInnerScope('this', thisScope);
|
|
315
315
|
return rootScope;
|
|
316
316
|
}
|
|
317
|
+
_attached = true;
|
|
318
|
+
_marked = {};
|
|
317
319
|
emit(propertyKey, newValue, oldValue) {
|
|
318
320
|
if (this._attached) {
|
|
319
321
|
super.emit(propertyKey, newValue, oldValue);
|
|
@@ -382,6 +384,10 @@ export class ModuleScope extends ReactiveScope {
|
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
386
|
export class WebModuleScope extends ModuleScope {
|
|
387
|
+
source;
|
|
388
|
+
importCallOptions;
|
|
389
|
+
// private loaded = false;
|
|
390
|
+
import;
|
|
385
391
|
constructor(source, importCallOptions) {
|
|
386
392
|
super({});
|
|
387
393
|
this.source = source;
|
package/scope/scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/expressions/scope/scope.ts"],"names":[],"mappings":"AAgEA,MAAM,OAAO,KAAK;IACjB,MAAM,CAAC,GAAG,CAAoB,GAAM,EAAE,YAA0B;QAC/D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,UAAU,CAAoB,YAA0B;QAC9D,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACzC,CAAC;IAKD,YAAsB,IAAO,EAAY,KAAmB;QAAtC,SAAI,GAAJ,IAAI,CAAG;QAAY,UAAK,GAAL,KAAK,CAAc;QAHlD,YAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAGa,CAAC;IACjE,GAAG,CAAC,GAAY;QACf,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IACD,GAAG,CAAC,GAAY,EAAE,KAAU,EAAE,QAAc;QAC3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AE,KAAkB;QAChE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;CACD;AACD,MAAM,OAAO,cAAe,SAAQ,WAAW;IAI9C,YAAoB,MAAc,EAAU,iBAAqC;QAChF,KAAK,CAAC,EAAmB,CAAC,CAAC;QADR,WAAM,GAAN,MAAM,CAAQ;QAAU,sBAAiB,GAAjB,iBAAiB,CAAoB;QAEhF,IAAI,CAAC,MAAM,GAAG,MAAM,CACnB,MAAM;QACN,4CAA4C,CAAC,gEAAgE;SAC7G,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvF,CAAC;IACO,aAAa,CAAC,OAAY;QACjC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD","sourcesContent":["import { TypeOf } from '../api/utils.js';\n\nexport type Context = Record<PropertyKey, any>;\nexport interface Scope<T = Context> {\n\n\t/**\n\t * get value of `propertyKey` in current context\n\t * @param propertyKey \n\t */\n\tget(propertyKey: keyof T): any;\n\n\t/**\n\t * set the value of `propertyKey` in current context, could be instilled with `value`.\n\t * @param propertyKey \n\t * @param value \n\t * @param receiver \n\t */\n\tset(propertyKey: keyof T, value?: any, receiver?: any): boolean;\n\n\t/**\n\t * is current context has `propertyKey` in hash map keys\n\t * @param propertyKey \n\t */\n\thas(propertyKey: keyof T): boolean;\n\n\t/**\n\t * delete property from context\n\t * @param propertyKey \n\t */\n\tdelete(propertyKey: keyof T): boolean;\n\n\t/**\n\t * get current context object of this scope\n\t */\n\tgetContext(): T;\n\n\t/**\n\t * get a proxy of the current context object if exists. \n\t */\n\tgetContextProxy?(): T;\n\n\t/**\n\t * get a scope for an object named as `propertyKey` from cache map,\n\t * \n\t * if the current value is not type od `object`, will return `undefined`.\n\t * @param propertyKey the name of the property\n\t */\n\tgetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S | undefined;\n\n\t/**\n\t * create a scope with the same type of this scope\n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S;\n\n\t/**\n\t * sc\n\t * @param propertyKey \n\t * @param scope \n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T, scope?: S): S;\n\n\tgetClass(): TypeOf<Scope<Context>>;\n}\n\nexport class Scope<T extends Context> implements Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope({} as T, propertyKeys);\n\t}\n\n\tprotected _inners = new Map<keyof T, Scope<any>>();\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[]);\n\tconstructor(protected _ctx: T, protected _keys?: (keyof T)[]) { }\n\tget(key: keyof T): any {\n\t\treturn Reflect.get(this._ctx, key);\n\t}\n\tset(key: keyof T, value: any, receiver?: any): boolean {\n\t\treturn Reflect.set(this._ctx, key, value);\n\t}\n\thas(key: keyof T): boolean {\n\t\treturn this._keys?.includes(key) ?? key in this._ctx;\n\t}\n\tdelete(key: keyof T): boolean {\n\t\treturn Reflect.deleteProperty(this._ctx, key);\n\t}\n\tgetContext(): T {\n\t\treturn this._ctx;\n\t}\n\tgetInnerScope<S extends Scope<Context>>(key: keyof T): S | undefined {\n\t\tconst ctx = this.get(key);\n\t\tlet scope = this._inners.get(key);\n\t\tif (scope) {\n\t\t\tscope._ctx = ctx;\n\t\t\treturn scope as S;\n\t\t}\n\t\tif (!(ctx && typeof ctx === 'object')) {\n\t\t\treturn;\n\t\t}\n\t\tscope = new (this.getClass())(ctx, undefined, key, this);\n\t\tthis._inners.set(key, scope);\n\t\treturn scope as S;\n\t}\n\tsetInnerScope<S extends Scope<Context>>(key: keyof T, scope?: S): S {\n\t\tif (scope) {\n\t\t\tthis._inners.set(key, scope);\n\t\t\treturn scope;\n\t\t}\n\t\tconst ctx = this.get(key);\n\t\tscope = new (this.getClass())(ctx, undefined, key, this) as S;\n\t\tthis._inners.set(key, scope);\n\t\treturn scope;\n\t}\n\tgetClass(): TypeOf<Scope<Context>> {\n\t\treturn Scope;\n\t}\n}\n\nexport class ReadOnlyScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope({} as T, propertyKeys);\n\t}\n\tset(propertyKey: keyof T, value: any, receiver?: any): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tgetClass(): TypeOf<ReadOnlyScope<Context>> {\n\t\treturn ReadOnlyScope;\n\t}\n}\n\nexport class ScopeSubscription<T> {\n\tconstructor(private propertyKey: keyof T, private observer: ValueChangeObserver<T>) { }\n\tpause() {\n\t\tthis.observer.pause(this.propertyKey, this);\n\t}\n\tresume() {\n\t\tthis.observer.resume(this.propertyKey, this);\n\t}\n\tunsubscribe(): void {\n\t\tthis.observer.unsubscribe(this.propertyKey, this);\n\t}\n}\n\nexport type ValueChangedCallback = (newValue: any, oldValue?: any) => void;\n\ntype SubscriptionInfo = { callback: ValueChangedCallback, enable: boolean };\n\nexport class ValueChangeObserver<T> {\n\tprivate _subscribers: Map<keyof T, Map<ScopeSubscription<T>, SubscriptionInfo>> = new Map();\n\tprivate _lock: (keyof T)[] = [];\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._lock.includes(propertyKey)) {\n\t\t\treturn;\n\t\t}\n\t\tconst subscribers = this._subscribers.get(propertyKey);\n\t\tif (!subscribers || subscribers.size == 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lock.push(propertyKey);\n\t\tsubscribers?.forEach(subscriptionInfo => {\n\t\t\tif (!subscriptionInfo.enable) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tsubscriptionInfo.callback(newValue, oldValue);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t});\n\t\tif (this._lock.pop() !== propertyKey) {\n\t\t\tconsole.error('lock error');\n\t\t};\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\tconst subscription: ScopeSubscription<T> = new ScopeSubscription(propertyKey, this);\n\t\tlet propertySubscribers = this._subscribers.get(propertyKey);\n\t\tif (!propertySubscribers) {\n\t\t\tpropertySubscribers = new Map();\n\t\t\tthis._subscribers.set(propertyKey, propertySubscribers);\n\t\t}\n\t\tpropertySubscribers.set(subscription, { callback, enable: true });\n\t\treturn subscription;\n\t}\n\n\tunsubscribe(propertyKey: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (subscription) {\n\t\t\tthis._subscribers.get(propertyKey)?.delete(subscription);\n\t\t} else {\n\t\t\tthis._subscribers.delete(propertyKey);\n\t\t}\n\t}\n\n\tpause(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = false);\n\t}\n\n\tresume(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = true);\n\t}\n\n\t/**\n\t * check if this Observer has any subscribers\n\t */\n\thasSubscribers(): boolean;\n\n\t/**\n\t * check if there is any subscribers registered by the propertyKey.\n\t * \n\t * @param propertyKey\n\t */\n\thasSubscribers(propertyKey: keyof T): boolean;\n\thasSubscribers(propertyKey?: keyof T): boolean {\n\t\tif (propertyKey) {\n\t\t\treturn (this._subscribers.get(propertyKey)?.size ?? 0) > 0;\n\t\t}\n\t\treturn this._subscribers.size > 0;\n\t}\n\n\t/**\n\t * clear subscription maps\n\t */\n\tdestroy() {\n\t\tthis._subscribers.clear();\n\t}\n}\n\nexport class ReactiveScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tprotected _clone: T;\n\tdeclare protected _inners: Map<keyof T, ReactiveScope<any>>;\n\tprotected _observer: ValueChangeObserver<T> = new ValueChangeObserver<T>();\n\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[], protected _name?: keyof T, protected _parent?: ReactiveScope<any>) {\n\t\tsuper(context, propertyKeys);\n\t\tthis._clone = Object.assign({}, context);\n\t}\n\n\tset(propertyKey: keyof T, newValue: any, receiver?: any): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst result = Reflect.set(this._ctx, propertyKey, newValue);\n\t\tif (result) {\n\t\t\tthis.emit(propertyKey, newValue, oldValue);\n\t\t}\n\t\treturn result;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst isDelete = Reflect.deleteProperty(this._ctx, propertyKey);\n\t\tif (isDelete && oldValue !== undefined) {\n\t\t\tthis.emit(propertyKey, undefined, oldValue);\n\t\t}\n\t\treturn isDelete;\n\t}\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tthis._observer.emit(propertyKey, newValue, oldValue);\n\t\tthis._parent?.emit(this._name!, this._ctx);\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\treturn this._observer.subscribe(propertyKey, callback);\n\t}\n\tunsubscribe(propertyKey?: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (propertyKey && subscription) {\n\t\t\tthis._observer.unsubscribe(propertyKey, subscription);\n\t\t} else if (propertyKey) {\n\t\t\tthis._observer.unsubscribe(propertyKey);\n\t\t} else {\n\t\t\tthis._observer.destroy();\n\t\t}\n\t}\n\tdetectChanges() {\n\t\tconst previous = this._clone;\n\t\tconst current = this._ctx;\n\t\tif ((!!!previous && !!current) || (!!previous && !!!current)) {\n\t\t\tthis._parent?.emit(this._name!, current);\n\t\t\treturn;\n\t\t}\n\t\tconst keys = this._keys ?? this.getPropertyKeys(previous, current);\n\t\tkeys.forEach(key => {\n\t\t\tconst pv = previous[key];\n\t\t\tconst cv = current[key];\n\t\t\tconst pt = typeof pv;\n\t\t\tconst ct = typeof cv;\n\t\t\tif (pt === 'object') {\n\t\t\t\tif (ct === 'object' && pv == cv) {\n\t\t\t\t\tthis.getInnerScope<ReactiveScope<Context>>(key)?.detectChanges();\n\t\t\t\t} else if (cv != pv) {\n\t\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t\t}\n\t\t\t} else if (ct === 'object') {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t} else if (pv != cv) {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t}\n\t\t});\n\t\tthis._clone = Object.assign({}, this._ctx);\n\t}\n\tprotected getPropertyKeys<V extends Record<PropertyKey, any>>(...objs: V[]) {\n\t\tlet keys: (keyof V)[] = [];\n\t\tobjs.forEach(obj => {\n\t\t\tkeys.push(...Object.keys(obj));\n\t\t\tkeys.push(...Object.getOwnPropertySymbols(obj));\n\t\t});\n\t\tkeys = Array.from(new Set(keys));\n\t\tkeys = keys.filter(key => {\n\t\t\tswitch (typeof key) {\n\t\t\t\tcase 'string':\n\t\t\t\t\treturn !key.startsWith('_');\n\t\t\t\tcase 'symbol':\n\t\t\t\t\treturn !key.toString().startsWith('Symbol(_');\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturn keys;\n\t}\n\tgetClass(): TypeOf<ReactiveScope<Context>> {\n\t\treturn ReactiveScope;\n\t}\n}\n\n/**\n * used control/notify/pause scope about changes in current context\n */\nexport interface ScopeControl<T extends Context> {\n\n\t/**\n\t * get current stacte of applying change detection.\n\t */\n\tisAttached(): boolean;\n\n\t/**\n\t * used when want to update ui-view like, you want to replace an array with another \n\t * without reflect changes on view until reattached again.\n\t */\n\tdetach(): void;\n\n\t/**\n\t * apply all the not emitted changes, and continue emit in time.\n\t */\n\treattach(): void;\n\n\t/**\n\t * apply changes now,\n\t * will not effect the state of the detector wither if attached ot not.\n\t * \n\t * if a propertyKey is provided, will emit this property only \n\t * @param propertyKey \n\t */\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void;\n\n\t/**\n\t * throw error if any changes has been made\n\t */\n\tcheckNoChanges(): void;\n}\n\nexport class ReactiveScopeControl<T extends Context> extends ReactiveScope<T> implements ScopeControl<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\n\tprotected _attached: boolean = true;\n\tprotected _marked: { [key: keyof Context]: [any, any] } = {};\n\n\toverride emit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._attached) {\n\t\t\tsuper.emit(propertyKey, newValue, oldValue);\n\t\t} else if (this._marked[propertyKey as string]) {\n\t\t\tif (newValue == this._marked[propertyKey as string][1]) {\n\t\t\t\tdelete this._marked[propertyKey as string];\n\t\t\t} else {\n\t\t\t\tthis._marked[propertyKey as string][0] = newValue;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._marked[propertyKey as string] = [newValue, oldValue];\n\t\t}\n\t}\n\tisAttached(): boolean {\n\t\treturn this._attached;\n\t}\n\tdetach(): void {\n\t\tthis._attached = false;\n\t}\n\treattach(): void {\n\t\tthis._attached = true;\n\t\tthis.emitChanges();\n\t}\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void {\n\t\tif (propertyKey) {\n\t\t\tsuper.emit(propertyKey, propertyValue);\n\t\t\tReflect.deleteProperty(this._marked, propertyKey);\n\t\t\treturn;\n\t\t}\n\t\tconst latestChanges = this._marked;\n\t\tthis._marked = {};\n\t\tconst keys = this._keys ?? this.getPropertyKeys(latestChanges);\n\t\tkeys.forEach(propertyKey => {\n\t\t\tthis._observer.emit(propertyKey, latestChanges[propertyKey][0], latestChanges[propertyKey][1]);\n\t\t});\n\t\tkeys.length && this._parent?.emit(this._name!, this._ctx);\n\t}\n\tdetectChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tthis.reattach();\n\t}\n\tcheckNoChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tconst keys = Object.keys(this._marked);\n\t\tif (keys.length > 0) {\n\t\t\tthrow new Error(`Some Changes had been detected`);\n\t\t}\n\t}\n\tgetClass(): TypeOf<ReactiveScopeControl<Context>> {\n\t\treturn ReactiveScopeControl;\n\t}\n}\n\n\ninterface ImportMeta {\n\turl: URL;\n\t/**\n\t *\n\t * Provides a module-relative resolution function scoped to each module, returning\n\t * the URL string.\n\t *\n\t * @param specified The module specifier to resolve relative to `parent`.\n\t * @param parent The absolute parent module URL to resolve from. If none\n\t * is specified, the value of `import.meta.url` is used as the default.\n\t */\n\tresolve?(specified: string, parent?: string | URL): Promise<string>;\n}\n\nexport interface ModuleImport {\n\tmeta: ImportMeta\n}\n\nexport interface ModuleContext extends Context {\n\timport: ModuleImport & ((path: string) => Promise<any>);\n}\n\nexport class ModuleScope extends ReactiveScope<ModuleContext> {\n\tconstructor(context: ModuleContext, propertyKeys?: (keyof ModuleContext)[]) {\n\t\tsuper(context, propertyKeys);\n\t}\n\timportModule(propertyKey: keyof ModuleContext, scope: ModuleScope): void {\n\t\tthis._ctx[propertyKey] = scope._ctx;\n\t\tthis._inners.set(propertyKey, scope);\n\t\tthis.detectChanges();\n\t}\n}\nexport class WebModuleScope extends ModuleScope {\n\n\t// private loaded = false;\n\tprivate import: Promise<any>;\n\tconstructor(private source: string, private importCallOptions?: ImportCallOptions) {\n\t\tsuper({} as ModuleContext);\n\t\tthis.import = import(\n\t\t\tsource\n\t\t\t/*, { assert: importCallOptions?.assert } */ // TODO: update in future, node16, ESNEXT,ES2022, ES2023, ES2024\n\t\t).then(module => (this.updateContext(module))).then(() => this._ctx, () => this._ctx);\n\t}\n\tprivate updateContext(context: any) {\n\t\tthis._ctx = context;\n\t\tthis.detectChanges();\n\t}\n\n\tresolveImport() {\n\t\treturn this.import;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/expressions/scope/scope.ts"],"names":[],"mappings":"AAgEA,MAAM,OAAO,KAAK;IAWK;IAAmB;IAVzC,MAAM,CAAC,GAAG,CAAoB,GAAM,EAAE,YAA0B;QAC/D,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,UAAU,CAAoB,YAA0B;QAC9D,OAAO,IAAI,KAAK,CAAC,EAAO,EAAE,YAAY,CAAC,CAAC;IACzC,CAAC;IAES,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAGnD,YAAsB,IAAO,EAAY,KAAmB;QAAtC,SAAI,GAAJ,IAAI,CAAG;QAAY,UAAK,GAAL,KAAK,CAAc;IAAI,CAAC;IACjE,GAAG,CAAC,GAAY;QACf,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IACD,GAAG,CAAC,GAAY,EAAE,KA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,CAAC,WAAgC,EAAE,KAAkB;QAChE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;CACD;AACD,MAAM,OAAO,cAAe,SAAQ,WAAW;IAI1B;IAAwB;IAF5C,0BAA0B;IAClB,MAAM,CAAe;IAC7B,YAAoB,MAAc,EAAU,iBAAqC;QAChF,KAAK,CAAC,EAAmB,CAAC,CAAC;QADR,WAAM,GAAN,MAAM,CAAQ;QAAU,sBAAiB,GAAjB,iBAAiB,CAAoB;QAEhF,IAAI,CAAC,MAAM,GAAG,MAAM,CACnB,MAAM;QACN,4CAA4C,CAAC,gEAAgE;SAC7G,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvF,CAAC;IACO,aAAa,CAAC,OAAY;QACjC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,aAAa,EAAE,CAAC;IACtB,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;CACD","sourcesContent":["import { TypeOf } from '../api/utils.js';\n\nexport type Context = Record<PropertyKey, any>;\nexport interface Scope<T = Context> {\n\n\t/**\n\t * get value of `propertyKey` in current context\n\t * @param propertyKey \n\t */\n\tget(propertyKey: keyof T): any;\n\n\t/**\n\t * set the value of `propertyKey` in current context, could be instilled with `value`.\n\t * @param propertyKey \n\t * @param value \n\t * @param receiver \n\t */\n\tset(propertyKey: keyof T, value?: any, receiver?: any): boolean;\n\n\t/**\n\t * is current context has `propertyKey` in hash map keys\n\t * @param propertyKey \n\t */\n\thas(propertyKey: keyof T): boolean;\n\n\t/**\n\t * delete property from context\n\t * @param propertyKey \n\t */\n\tdelete(propertyKey: keyof T): boolean;\n\n\t/**\n\t * get current context object of this scope\n\t */\n\tgetContext(): T;\n\n\t/**\n\t * get a proxy of the current context object if exists. \n\t */\n\tgetContextProxy?(): T;\n\n\t/**\n\t * get a scope for an object named as `propertyKey` from cache map,\n\t * \n\t * if the current value is not type od `object`, will return `undefined`.\n\t * @param propertyKey the name of the property\n\t */\n\tgetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S | undefined;\n\n\t/**\n\t * create a scope with the same type of this scope\n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T): S;\n\n\t/**\n\t * sc\n\t * @param propertyKey \n\t * @param scope \n\t */\n\tsetInnerScope<S extends Scope<Context>>(propertyKey: keyof T, scope?: S): S;\n\n\tgetClass(): TypeOf<Scope<Context>>;\n}\n\nexport class Scope<T extends Context> implements Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new Scope({} as T, propertyKeys);\n\t}\n\n\tprotected _inners = new Map<keyof T, Scope<any>>();\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[]);\n\tconstructor(protected _ctx: T, protected _keys?: (keyof T)[]) { }\n\tget(key: keyof T): any {\n\t\treturn Reflect.get(this._ctx, key);\n\t}\n\tset(key: keyof T, value: any, receiver?: any): boolean {\n\t\treturn Reflect.set(this._ctx, key, value);\n\t}\n\thas(key: keyof T): boolean {\n\t\treturn this._keys?.includes(key) ?? key in this._ctx;\n\t}\n\tdelete(key: keyof T): boolean {\n\t\treturn Reflect.deleteProperty(this._ctx, key);\n\t}\n\tgetContext(): T {\n\t\treturn this._ctx;\n\t}\n\tgetInnerScope<S extends Scope<Context>>(key: keyof T): S | undefined {\n\t\tconst ctx = this.get(key);\n\t\tlet scope = this._inners.get(key);\n\t\tif (scope) {\n\t\t\tscope._ctx = ctx;\n\t\t\treturn scope as S;\n\t\t}\n\t\tif (!(ctx && typeof ctx === 'object')) {\n\t\t\treturn;\n\t\t}\n\t\tscope = new (this.getClass())(ctx, undefined, key, this);\n\t\tthis._inners.set(key, scope);\n\t\treturn scope as S;\n\t}\n\tsetInnerScope<S extends Scope<Context>>(key: keyof T, scope?: S): S {\n\t\tif (scope) {\n\t\t\tthis._inners.set(key, scope);\n\t\t\treturn scope;\n\t\t}\n\t\tconst ctx = this.get(key);\n\t\tscope = new (this.getClass())(ctx, undefined, key, this) as S;\n\t\tthis._inners.set(key, scope);\n\t\treturn scope;\n\t}\n\tgetClass(): TypeOf<Scope<Context>> {\n\t\treturn Scope;\n\t}\n}\n\nexport class ReadOnlyScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope(ctx, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReadOnlyScope({} as T, propertyKeys);\n\t}\n\tset(propertyKey: keyof T, value: any, receiver?: any): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\t// do nothing\n\t\treturn false;\n\t}\n\tgetClass(): TypeOf<ReadOnlyScope<Context>> {\n\t\treturn ReadOnlyScope;\n\t}\n}\n\nexport class ScopeSubscription<T> {\n\tconstructor(private propertyKey: keyof T, private observer: ValueChangeObserver<T>) { }\n\tpause() {\n\t\tthis.observer.pause(this.propertyKey, this);\n\t}\n\tresume() {\n\t\tthis.observer.resume(this.propertyKey, this);\n\t}\n\tunsubscribe(): void {\n\t\tthis.observer.unsubscribe(this.propertyKey, this);\n\t}\n}\n\nexport type ValueChangedCallback = (newValue: any, oldValue?: any) => void;\n\ntype SubscriptionInfo = { callback: ValueChangedCallback, enable: boolean };\n\nexport class ValueChangeObserver<T> {\n\tprivate _subscribers: Map<keyof T, Map<ScopeSubscription<T>, SubscriptionInfo>> = new Map();\n\tprivate _lock: (keyof T)[] = [];\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._lock.includes(propertyKey)) {\n\t\t\treturn;\n\t\t}\n\t\tconst subscribers = this._subscribers.get(propertyKey);\n\t\tif (!subscribers || subscribers.size == 0) {\n\t\t\treturn;\n\t\t}\n\t\tthis._lock.push(propertyKey);\n\t\tsubscribers?.forEach(subscriptionInfo => {\n\t\t\tif (!subscriptionInfo.enable) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tsubscriptionInfo.callback(newValue, oldValue);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t});\n\t\tif (this._lock.pop() !== propertyKey) {\n\t\t\tconsole.error('lock error');\n\t\t};\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\tconst subscription: ScopeSubscription<T> = new ScopeSubscription(propertyKey, this);\n\t\tlet propertySubscribers = this._subscribers.get(propertyKey);\n\t\tif (!propertySubscribers) {\n\t\t\tpropertySubscribers = new Map();\n\t\t\tthis._subscribers.set(propertyKey, propertySubscribers);\n\t\t}\n\t\tpropertySubscribers.set(subscription, { callback, enable: true });\n\t\treturn subscription;\n\t}\n\n\tunsubscribe(propertyKey: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (subscription) {\n\t\t\tthis._subscribers.get(propertyKey)?.delete(subscription);\n\t\t} else {\n\t\t\tthis._subscribers.delete(propertyKey);\n\t\t}\n\t}\n\n\tpause(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = false);\n\t}\n\n\tresume(propertyKey: keyof T, subscription: ScopeSubscription<T>) {\n\t\tconst subscriptionInfo = this._subscribers.get(propertyKey)?.get(subscription);\n\t\tsubscriptionInfo && (subscriptionInfo.enable = true);\n\t}\n\n\t/**\n\t * check if this Observer has any subscribers\n\t */\n\thasSubscribers(): boolean;\n\n\t/**\n\t * check if there is any subscribers registered by the propertyKey.\n\t * \n\t * @param propertyKey\n\t */\n\thasSubscribers(propertyKey: keyof T): boolean;\n\thasSubscribers(propertyKey?: keyof T): boolean {\n\t\tif (propertyKey) {\n\t\t\treturn (this._subscribers.get(propertyKey)?.size ?? 0) > 0;\n\t\t}\n\t\treturn this._subscribers.size > 0;\n\t}\n\n\t/**\n\t * clear subscription maps\n\t */\n\tdestroy() {\n\t\tthis._subscribers.clear();\n\t}\n}\n\nexport class ReactiveScope<T extends Context> extends Scope<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScope({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tprotected _clone: T;\n\tdeclare protected _inners: Map<keyof T, ReactiveScope<any>>;\n\tprotected _observer: ValueChangeObserver<T> = new ValueChangeObserver<T>();\n\n\n\tconstructor(context: T, propertyKeys?: (keyof T)[], protected _name?: keyof T, protected _parent?: ReactiveScope<any>) {\n\t\tsuper(context, propertyKeys);\n\t\tthis._clone = Object.assign({}, context);\n\t}\n\n\tset(propertyKey: keyof T, newValue: any, receiver?: any): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst result = Reflect.set(this._ctx, propertyKey, newValue);\n\t\tif (result) {\n\t\t\tthis.emit(propertyKey, newValue, oldValue);\n\t\t}\n\t\treturn result;\n\t}\n\tdelete(propertyKey: keyof T): boolean {\n\t\tconst oldValue = Reflect.get(this._ctx, propertyKey);\n\t\tconst isDelete = Reflect.deleteProperty(this._ctx, propertyKey);\n\t\tif (isDelete && oldValue !== undefined) {\n\t\t\tthis.emit(propertyKey, undefined, oldValue);\n\t\t}\n\t\treturn isDelete;\n\t}\n\temit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tthis._observer.emit(propertyKey, newValue, oldValue);\n\t\tthis._parent?.emit(this._name!, this._ctx);\n\t}\n\tsubscribe(propertyKey: keyof T, callback: ValueChangedCallback): ScopeSubscription<T> {\n\t\treturn this._observer.subscribe(propertyKey, callback);\n\t}\n\tunsubscribe(propertyKey?: keyof T, subscription?: ScopeSubscription<T>) {\n\t\tif (propertyKey && subscription) {\n\t\t\tthis._observer.unsubscribe(propertyKey, subscription);\n\t\t} else if (propertyKey) {\n\t\t\tthis._observer.unsubscribe(propertyKey);\n\t\t} else {\n\t\t\tthis._observer.destroy();\n\t\t}\n\t}\n\tdetectChanges() {\n\t\tconst previous = this._clone;\n\t\tconst current = this._ctx;\n\t\tif ((!!!previous && !!current) || (!!previous && !!!current)) {\n\t\t\tthis._parent?.emit(this._name!, current);\n\t\t\treturn;\n\t\t}\n\t\tconst keys = this._keys ?? this.getPropertyKeys(previous, current);\n\t\tkeys.forEach(key => {\n\t\t\tconst pv = previous[key];\n\t\t\tconst cv = current[key];\n\t\t\tconst pt = typeof pv;\n\t\t\tconst ct = typeof cv;\n\t\t\tif (pt === 'object') {\n\t\t\t\tif (ct === 'object' && pv == cv) {\n\t\t\t\t\tthis.getInnerScope<ReactiveScope<Context>>(key)?.detectChanges();\n\t\t\t\t} else if (cv != pv) {\n\t\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t\t}\n\t\t\t} else if (ct === 'object') {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t} else if (pv != cv) {\n\t\t\t\tthis.emit(key, cv, pv);\n\t\t\t}\n\t\t});\n\t\tthis._clone = Object.assign({}, this._ctx);\n\t}\n\tprotected getPropertyKeys<V extends Record<PropertyKey, any>>(...objs: V[]) {\n\t\tlet keys: (keyof V)[] = [];\n\t\tobjs.forEach(obj => {\n\t\t\tkeys.push(...Object.keys(obj));\n\t\t\tkeys.push(...Object.getOwnPropertySymbols(obj));\n\t\t});\n\t\tkeys = Array.from(new Set(keys));\n\t\tkeys = keys.filter(key => {\n\t\t\tswitch (typeof key) {\n\t\t\t\tcase 'string':\n\t\t\t\t\treturn !key.startsWith('_');\n\t\t\t\tcase 'symbol':\n\t\t\t\t\treturn !key.toString().startsWith('Symbol(_');\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\treturn keys;\n\t}\n\tgetClass(): TypeOf<ReactiveScope<Context>> {\n\t\treturn ReactiveScope;\n\t}\n}\n\n/**\n * used control/notify/pause scope about changes in current context\n */\nexport interface ScopeControl<T extends Context> {\n\n\t/**\n\t * get current stacte of applying change detection.\n\t */\n\tisAttached(): boolean;\n\n\t/**\n\t * used when want to update ui-view like, you want to replace an array with another \n\t * without reflect changes on view until reattached again.\n\t */\n\tdetach(): void;\n\n\t/**\n\t * apply all the not emitted changes, and continue emit in time.\n\t */\n\treattach(): void;\n\n\t/**\n\t * apply changes now,\n\t * will not effect the state of the detector wither if attached ot not.\n\t * \n\t * if a propertyKey is provided, will emit this property only \n\t * @param propertyKey \n\t */\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void;\n\n\t/**\n\t * throw error if any changes has been made\n\t */\n\tcheckNoChanges(): void;\n}\n\nexport class ReactiveScopeControl<T extends Context> extends ReactiveScope<T> implements ScopeControl<T> {\n\tstatic for<T extends Context>(context: T, propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl(context, propertyKeys);\n\t}\n\tstatic blockScope<T extends Context>(propertyKeys?: (keyof T)[]) {\n\t\treturn new ReactiveScopeControl({} as T, propertyKeys);\n\t}\n\tstatic scopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic readOnlyScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScopeControl.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = ReadOnlyScope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\tstatic reactiveScopeForThis<T extends Context>(ctx: T, propertyKeys?: (keyof T)[]) {\n\t\tconst thisScope = ReactiveScope.for(ctx, propertyKeys);\n\t\tconst thisCtx = {\n\t\t\t'this': ctx,\n\t\t};\n\t\tconst rootScope = Scope.for(thisCtx, ['this']);\n\t\trootScope.setInnerScope('this', thisScope);\n\t\treturn rootScope;\n\t}\n\n\tprotected _attached: boolean = true;\n\tprotected _marked: { [key: keyof Context]: [any, any] } = {};\n\n\toverride emit(propertyKey: keyof T, newValue: any, oldValue?: any): void {\n\t\tif (this._attached) {\n\t\t\tsuper.emit(propertyKey, newValue, oldValue);\n\t\t} else if (this._marked[propertyKey as string]) {\n\t\t\tif (newValue == this._marked[propertyKey as string][1]) {\n\t\t\t\tdelete this._marked[propertyKey as string];\n\t\t\t} else {\n\t\t\t\tthis._marked[propertyKey as string][0] = newValue;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._marked[propertyKey as string] = [newValue, oldValue];\n\t\t}\n\t}\n\tisAttached(): boolean {\n\t\treturn this._attached;\n\t}\n\tdetach(): void {\n\t\tthis._attached = false;\n\t}\n\treattach(): void {\n\t\tthis._attached = true;\n\t\tthis.emitChanges();\n\t}\n\temitChanges(propertyKey?: keyof T, propertyValue?: any): void {\n\t\tif (propertyKey) {\n\t\t\tsuper.emit(propertyKey, propertyValue);\n\t\t\tReflect.deleteProperty(this._marked, propertyKey);\n\t\t\treturn;\n\t\t}\n\t\tconst latestChanges = this._marked;\n\t\tthis._marked = {};\n\t\tconst keys = this._keys ?? this.getPropertyKeys(latestChanges);\n\t\tkeys.forEach(propertyKey => {\n\t\t\tthis._observer.emit(propertyKey, latestChanges[propertyKey][0], latestChanges[propertyKey][1]);\n\t\t});\n\t\tkeys.length && this._parent?.emit(this._name!, this._ctx);\n\t}\n\tdetectChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tthis.reattach();\n\t}\n\tcheckNoChanges() {\n\t\tthis.detach();\n\t\tsuper.detectChanges();\n\t\tconst keys = Object.keys(this._marked);\n\t\tif (keys.length > 0) {\n\t\t\tthrow new Error(`Some Changes had been detected`);\n\t\t}\n\t}\n\tgetClass(): TypeOf<ReactiveScopeControl<Context>> {\n\t\treturn ReactiveScopeControl;\n\t}\n}\n\n\ninterface ImportMeta {\n\turl: URL;\n\t/**\n\t *\n\t * Provides a module-relative resolution function scoped to each module, returning\n\t * the URL string.\n\t *\n\t * @param specified The module specifier to resolve relative to `parent`.\n\t * @param parent The absolute parent module URL to resolve from. If none\n\t * is specified, the value of `import.meta.url` is used as the default.\n\t */\n\tresolve?(specified: string, parent?: string | URL): Promise<string>;\n}\n\nexport interface ModuleImport {\n\tmeta: ImportMeta\n}\n\nexport interface ModuleContext extends Context {\n\timport: ModuleImport & ((path: string) => Promise<any>);\n}\n\nexport class ModuleScope extends ReactiveScope<ModuleContext> {\n\tconstructor(context: ModuleContext, propertyKeys?: (keyof ModuleContext)[]) {\n\t\tsuper(context, propertyKeys);\n\t}\n\timportModule(propertyKey: keyof ModuleContext, scope: ModuleScope): void {\n\t\tthis._ctx[propertyKey] = scope._ctx;\n\t\tthis._inners.set(propertyKey, scope);\n\t\tthis.detectChanges();\n\t}\n}\nexport class WebModuleScope extends ModuleScope {\n\n\t// private loaded = false;\n\tprivate import: Promise<any>;\n\tconstructor(private source: string, private importCallOptions?: ImportCallOptions) {\n\t\tsuper({} as ModuleContext);\n\t\tthis.import = import(\n\t\t\tsource\n\t\t\t/*, { assert: importCallOptions?.assert } */ // TODO: update in future, node16, ESNEXT,ES2022, ES2023, ES2024\n\t\t).then(module => (this.updateContext(module))).then(() => this._ctx, () => this._ctx);\n\t}\n\tprivate updateContext(context: any) {\n\t\tthis._ctx = context;\n\t\tthis.detectChanges();\n\t}\n\n\tresolveImport() {\n\t\treturn this.import;\n\t}\n}\n"]}
|
package/scope/stack.d.ts
CHANGED
|
@@ -160,3 +160,4 @@ export declare class ModuleScopeResolver implements ModuleScopeResolver {
|
|
|
160
160
|
protected resolveExternalModule(source: string, importCallOptions?: ImportCallOptions): WebModuleScope;
|
|
161
161
|
protected readonly isValidHTTPUrl: (string: string) => boolean;
|
|
162
162
|
}
|
|
163
|
+
//# sourceMappingURL=stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../src/expressions/scope/stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAIlE,OAAO,EACuB,WAAW,EAAE,aAAa,EACjC,KAAK,EAAE,OAAO,EAAE,cAAc,EACpD,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACt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ack(globalScopes, resolver, moduleSource);
|
|
20
20
|
}
|
|
21
|
+
awaitPromise = [];
|
|
22
|
+
forAwaitAsyncIterable;
|
|
23
|
+
stack;
|
|
24
|
+
moduleScope;
|
|
25
|
+
moduleSource;
|
|
26
|
+
resolver;
|
|
27
|
+
onDestroyActions = [];
|
|
21
28
|
constructor(globals, resolver, moduleSource) {
|
|
22
|
-
this.awaitPromise = [];
|
|
23
|
-
this.onDestroyActions = [];
|
|
24
29
|
if (Array.isArray(globals)) {
|
|
25
30
|
this.stack = globals.slice();
|
|
26
31
|
}
|
|
@@ -42,7 +47,7 @@ export class Stack {
|
|
|
42
47
|
// for the rest of module body
|
|
43
48
|
this.pushReactiveScope();
|
|
44
49
|
}
|
|
45
|
-
else {
|
|
50
|
+
else if (this.stack.length === 0) {
|
|
46
51
|
// not a module scope
|
|
47
52
|
this.pushBlockScope();
|
|
48
53
|
}
|
|
@@ -177,21 +182,14 @@ export function createRootURL(source) {
|
|
|
177
182
|
}
|
|
178
183
|
;
|
|
179
184
|
export class ModuleScopeResolver {
|
|
185
|
+
globalStack;
|
|
186
|
+
provider;
|
|
187
|
+
config;
|
|
188
|
+
modules = [];
|
|
180
189
|
constructor(globalStack, provider, config) {
|
|
181
190
|
this.globalStack = globalStack;
|
|
182
191
|
this.provider = provider;
|
|
183
192
|
this.config = config;
|
|
184
|
-
this.modules = [];
|
|
185
|
-
this.isValidHTTPUrl = (string) => {
|
|
186
|
-
let url;
|
|
187
|
-
try {
|
|
188
|
-
url = new URL(string);
|
|
189
|
-
}
|
|
190
|
-
catch (e) {
|
|
191
|
-
return false;
|
|
192
|
-
}
|
|
193
|
-
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
194
|
-
};
|
|
195
193
|
}
|
|
196
194
|
register(source, moduleScope) {
|
|
197
195
|
const stackInfo = this.modules.find(tuple => tuple[0] == source && tuple[1] == moduleScope);
|
|
@@ -258,5 +256,15 @@ export class ModuleScopeResolver {
|
|
|
258
256
|
this.modules.push([source, webScope]);
|
|
259
257
|
return webScope;
|
|
260
258
|
}
|
|
259
|
+
isValidHTTPUrl = (string) => {
|
|
260
|
+
let url;
|
|
261
|
+
try {
|
|
262
|
+
url = new URL(string);
|
|
263
|
+
}
|
|
264
|
+
catch (e) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
268
|
+
};
|
|
261
269
|
}
|
|
262
270
|
//# sourceMappingURL=stack.js.map
|
package/scope/stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../src/expressions/scope/stack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACuB,WAAW,EAAE,aAAa,EACvD,oBAAoB,EAAE,KAAK,EAAW,cAAc,EACpD,MAAM,YAAY,CAAC;AAyIpB,MAAM,OAAO,KAAK;IACjB,MAAM,CAAC,GAAG,CAAC,GAAG,QAA0B;QACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,OAAO,IAAI,KAAK,EAAE,CAAC;SACnB;QACD,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,KAAK,CAAU,OAAO,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,GAAG,MAAwB;QAC3C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;SAChC;QACD,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,MAAM,CAAC,WAAW,CAAC,Q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port { LanguageMode } from '../v8/language.js';\nimport { JavaScriptParser } from '../v8/parser.js';\nimport { finalizerRegister } from './finalizer.js';\nimport {\n\tModuleContext, ModuleImport, ModuleScope, ReactiveScope,\n\tReactiveScopeControl, Scope, Context, WebModuleScope\n} from './scope.js';\n\n\nexport interface AwaitPromiseInfo {\n\tpromise: Promise<any>;\n\tnode: DeclarationExpression;\n\n\tdeclareVariable: boolean;\n}\n\nexport interface AsyncIterableInfo {\n\titerable: AsyncIterable<any>;\n\tforAwaitBody: (iterator: any) => any;\n}\n\nexport interface Stack {\n\t/**\n\t * a list of promises to resolve in an 'async' scope as 'async function'\n\t */\n\tawaitPromise: Array<AwaitPromiseInfo>;\n\n\t/**\n\t * resolve await promise in 'await for in' scope\n\t */\n\tforAwaitAsyncIterable?: AsyncIterableInfo;\n\n\t/**\n\t * is this stack has a propertyKey\n\t * @param propertyKey \n\t */\n\thas(propertyKey: PropertyKey): boolean;\n\n\t/**\n\t * get the first value for provided property key,\n\t * \n\t * will search current stack in all scope till find the first key, else undefined\n\t * @param propertyKey \n\t */\n\tget(propertyKey: PropertyKey): any;\n\n\t/**\n\t * set the value of `propertyKey` in its context provider with `value`.\n\t * else define it in the first scope 'local scope'\n\t * @param propertyKey \n\t * @param value \n\t * @param receiver \n\t */\n\tset(propertyKey: PropertyKey, value: any, receiver?: any): boolean;\n\n\t/**\n\t * declare variable at last scope in the stack,\n\t * \n\t * @param propertyKey the name of property mey be string | number | symbol, \n\t * @param propertyValue if not exist will be initialize with 'undefined' value\n\t */\n\tdeclareVariable(propertyKey: PropertyKey, propertyValue?: any): any;\n\n\n\t/**\n\t * get context object of this provider,\n\t * search for the first context object that has `propertyKey`.\n\t * \n\t * search for the first context that have property key,\n\t * if not found will return the stack local scop as a default value\n\t * @param propertyKey the property key\n\t */\n\tfindScope<T extends Context>(propertyKey: PropertyKey): Scope<T>;\n\n\tresolveAwait(value: AwaitPromiseInfo): void;\n\n\t/**\n\t * get a reference to the last scope in this stack\n\t */\n\tlastScope<T extends Context>(): Scope<T>;\n\n\t/**\n\t * clear every thing after this scope, and even this scope\n\t * @param scope \n\t */\n\tclearTo<T extends Context>(scope: Scope<T>): boolean;\n\n\t/**\n\t * clear every thing after this scope, but not this scope\n\t * @param scope \n\t */\n\tclearTill<T extends Context>(scope: Scope<T>): boolean;\n\n\tpopScope<T extends Context>(): Scope<T>;\n\n\tremoveScope<T extends Context>(scope: Scope<T>): void;\n\n\tpushScope<T extends Context>(scope: Scope<T>): void;\n\n\tpushBlockScope<T extends Context>(): Scope<T>;\n\n\tpushBlockScopeFor<T extends Context>(context: T): Scope<T>;\n\n\tpushReactiveScope<T extends Context>(): ReactiveScope<T>;\n\n\tpushReactiveScopeFor<T extends Context>(context: T): ReactiveScope<T>;\n\n\t/**\n\t * create new stack instance with the same reference to the current scope array\n\t */\n\tcopyStack(): Stack;\n\n\t/**\n\t * used when want to update ui-view like, you want to replace an array with another \n\t * without reflect changes on view until reattached again.\n\t */\n\tdetach(): void;\n\n\t/**\n\t * apply all the not emitted changes, and continue emit in time.\n\t */\n\treattach(): void;\n\n\t/**\n\t * import module scope from another stack, by the help of ModuleScopeResolver.\n\t * \n\t * used with import statement\n\t */\n\timportModule(source: string, importCallOptions?: ImportCallOptions): ModuleScope;\n\n\t/**\n\t * get the current module for this stack.\n\t * \n\t * used with export statement\n\t */\n\tgetModule(): ModuleScope | undefined;\n\n\t/**\n\t * register action to do on destroy this stack\n\t */\n\tonDestroy(action: () => void): void;\n}\n\nexport class Stack implements Stack {\n\tstatic for(...contexts: Scope<Context>[]): Stack {\n\t\tif (contexts.length === 0) {\n\t\t\treturn new Stack();\n\t\t}\n\t\treturn new Stack(contexts.map(context => new Scope<Context>(context)));\n\t}\n\tstatic forScopes(...scopes: Scope<Context>[]): Stack {\n\t\tif (scopes.length === 0) {\n\t\t\tscopes.push(Scope.blockScope());\n\t\t}\n\t\treturn new Stack(scopes);\n\t}\n\tstatic moduleScope(resolver: ModuleScopeResolver, moduleSource: string, ...globalScopes: Scope<Context>[]) {\n\t\treturn new Stack(globalScopes, resolver, moduleSource);\n\t}\n\tawaitPromise: AwaitPromiseInfo[] = [];\n\tforAwaitAsyncIterable?: AsyncIterableInfo | undefined;\n\n\tprotected readonly stack: Array<Scope<any>>;\n\tprotected readonly moduleScope?: ModuleScope;\n\tprotected readonly moduleSource?: string;\n\tprotected readonly resolver?: ModuleScopeResolver;\n\n\tprotected readonly onDestroyActions: (() => void)[] = [];\n\n\tconstructor();\n\tconstructor(globalScope: Scope<Context>);\n\tconstructor(globalScope: Scope<Context>, resolver: ModuleScopeResolver, moduleSource: string);\n\n\tconstructor(stack: Array<Scope<Context>>);\n\tconstructor(stack: Array<Scope<Context>>, resolver: ModuleScopeResolver, moduleSource: string);\n\n\tconstructor(stack: Stack);\n\tconstructor(stack: Stack, resolver: ModuleScopeResolver, moduleSource: string);\n\n\tconstructor(globals?: Stack | Array<Scope<Context>> | Scope<Context>, resolver?: ModuleScopeResolver, moduleSource?: string) {\n\t\tif (Array.isArray(globals)) {\n\t\t\tthis.stack = globals.slice();\n\t\t} else if (globals instanceof Stack) {\n\t\t\tthis.stack = globals.stack.slice();\n\t\t} else if (typeof globals == 'object') {\n\t\t\tthis.stack = [globals];\n\t\t} else {\n\t\t\tthis.stack = [];\n\t\t}\n\t\tif (resolver && moduleSource) {\n\t\t\tthis.resolver = resolver;\n\t\t\tthis.moduleSource = moduleSource;\n\t\t\t// init module scope for import and export\n\t\t\tthis.moduleScope = new ModuleScope(this.initModuleContext());\n\t\t\tthis.pushScope(this.moduleScope);\n\t\t\t// for the rest of module body\n\t\t\tthis.pushReactiveScope();\n\t\t} else {\n\t\t\t// not a module scope\n\t\t\tthis.pushBlockScope();\n\t\t}\n\t\tfinalizerRegister(this, this.onDestroyActions, this);\n\t}\n\tprivate initModuleContext(): ModuleContext {\n\t\tconst importFunc = (path: string) => {\n\t\t\tconst module = this.importModule(path);\n\t\t\tif (module instanceof WebModuleScope) {\n\t\t\t\treturn module.resolveImport();\n\t\t\t}\n\t\t\treturn Promise.resolve(module.getContext());\n\t\t};\n\t\timportFunc.meta = {\n\t\t\turl: createRootURL(this.moduleSource!),\n\t\t\tresolve: (specified: string, parent?: string | URL): Promise<string> => {\n\t\t\t\treturn Promise.resolve(this.resolver!.resolveURL(specified, parent ?? importFunc.meta.url));\n\t\t\t}\n\t\t};\n\t\tconst im: ModuleImport & ((path: string) => Promise<any>) = importFunc as any;\n\t\treturn { import: im };\n\t}\n\thas(propertyKey: PropertyKey): boolean {\n\t\treturn this.stack.find(context => context.has(propertyKey)) ? true : false;\n\t}\n\tget(propertyKey: PropertyKey) {\n\t\treturn this.findScope<Context>(propertyKey).get(propertyKey);\n\t}\n\tset(propertyKey: PropertyKey, value: any, receiver?: any): boolean {\n\t\treturn this.findScope<Context>(propertyKey).set(propertyKey, value, receiver);\n\t}\n\tdeclareVariable(propertyKey: PropertyKey, propertyValue?: any) {\n\t\treturn this.lastScope<Context>().set(propertyKey, propertyValue);\n\t}\n\tfindScope<T extends Context>(propertyKey: PropertyKey): Scope<T> {\n\t\tlet lastIndex = this.stack.length;\n\t\twhile (lastIndex--) {\n\t\t\tconst scope = this.stack[lastIndex];\n\t\t\tif (scope.has(propertyKey)) {\n\t\t\t\treturn scope;\n\t\t\t}\n\t\t}\n\t\treturn this.lastScope();\n\t}\n\tresolveAwait(value: AwaitPromiseInfo): void {\n\t\tthis.awaitPromise.push(value);\n\t}\n\tpopScope<T extends Context>(): Scope<T> {\n\t\treturn this.stack.pop()!;\n\t}\n\tremoveScope<T extends Context>(scope: Scope<T>): void {\n\t\tconst index = this.stack.lastIndexOf(scope);\n\t\tthis.stack.splice(index, 1);\n\t}\n\tpushScope<T extends Context>(scope: Scope<T>): void {\n\t\tthis.stack.push(scope);\n\t}\n\tpushBlockScope<T extends Context>(propertyKeys?: (keyof T)[]): Scope<T> {\n\t\tconst scope = Scope.blockScope<T>(propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushBlockScopeFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]): Scope<T> {\n\t\tconst scope = Scope.for<T>(context, propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushReactiveScope<T extends Context>(propertyKeys?: (keyof T)[]): ReactiveScope<T> {\n\t\tconst scope = ReactiveScope.blockScope<T>(propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushReactiveScopeFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]): ReactiveScope<T> {\n\t\tconst scope = ReactiveScope.for(context, propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tlastScope<T extends Context>(): Scope<T> {\n\t\treturn this.stack[this.stack.length - 1];\n\t}\n\tclearTo<T extends Context>(scope: Scope<T>): boolean {\n\t\tconst index = this.stack.lastIndexOf(scope);\n\t\tif (index === -1) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.stack.splice(index);\n\t\treturn true;\n\t}\n\tclearTill<T extends Context>(scope: Scope<T>): boolean {\n\t\tconst index = this.stack.lastIndexOf(scope);\n\t\tif (index === -1) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.stack.splice(index + 1);\n\t\treturn true;\n\t}\n\tcopyStack(): Stack {\n\t\treturn new Stack(this.stack.slice(), this.resolver!, this.moduleSource!);\n\t}\n\tdetach(): void {\n\t\tthis.getReactiveScopeControls().forEach(scope => scope.detach());\n\t}\n\treattach(): void {\n\t\tthis.getReactiveScopeControls().forEach(scope => scope.reattach());\n\t}\n\tdetectChanges() {\n\t\tthis.getReactiveScope().forEach(scope => scope.detectChanges());\n\t}\n\tprivate getReactiveScopeControls(): ReactiveScopeControl<any>[] {\n\t\treturn this.stack.filter(scope => scope instanceof ReactiveScopeControl) as ReactiveScopeControl<any>[];\n\t}\n\tprivate getReactiveScope(): ReactiveScope<any>[] {\n\t\treturn this.stack.filter(scope => scope instanceof ReactiveScope) as ReactiveScope<any>[];\n\t}\n\timportModule(source: string, importCallOptions?: ImportCallOptions): ModuleScope {\n\t\tif (!this.resolver || !this.moduleScope) {\n\t\t\t// should o the parse and import the module\n\t\t\tthrow new Error('Module Resolver is undefined');\n\t\t}\n\t\treturn this.resolver.resolve(source, this.moduleScope, importCallOptions);\n\t}\n\tgetModule(): ModuleScope | undefined {\n\t\treturn this.moduleScope;\n\t}\n\n\tonDestroy(action: () => void): void {\n\t\tthis.onDestroyActions.push(action);\n\t}\n}\n\n\nexport interface ModuleScopeResolver {\n\tresolve(source: string, moduleScope: ModuleScope, importCallOptions?: ImportCallOptions): ModuleScope;\n\tresolveURL(specified: string, parent: string | URL): string;\n}\n\nconst ROOT_URL = 'https://root';\nexport function createRootURL(source: string): URL {\n\treturn new URL(source, ROOT_URL);\n}\n\n\nexport interface ResolverConfig {\n\t/**\n\t * allow import modules from external http(s) module\n\t */\n\tallowImportExternal?: boolean;\n\n};\n\n/**\n * file system provider\n */\nexport interface ModuleSourceProvider {\n\t[url: string]: string;\n}\n\nexport class ModuleScopeResolver implements ModuleScopeResolver {\n\tprotected modules: [string, ModuleScope][] = [];\n\n\tconstructor(protected globalStack: Stack, protected provider: ModuleSourceProvider, protected config?: ResolverConfig) { }\n\tprivate register(source: string, moduleScope: ModuleScope) {\n\t\tconst stackInfo = this.modules.find(tuple => tuple[0] == source && tuple[1] == moduleScope);\n\t\tif (stackInfo) {\n\t\t\tstackInfo[1] = moduleScope;\n\t\t} else {\n\t\t\tthis.modules.push([source, moduleScope]);\n\t\t}\n\t}\n\tresolve(source: keyof ModuleSourceProvider): ModuleScope;\n\tresolve(source: keyof ModuleSourceProvider, moduleScope: ModuleScope, importCallOptions?: ImportCallOptions): ModuleScope;\n\tresolve(source: string, moduleScope?: ModuleScope, importCallOptions?: ImportCallOptions): ModuleScope {\n\t\tif (this.isValidHTTPUrl(source)) {\n\t\t\treturn this.resolveExternalModule(source, importCallOptions);\n\t\t}\n\t\tif (source.startsWith('/')) {\n\t\t\treturn this.findScopeBySource(source, importCallOptions);\n\t\t}\n\t\tconst currentSource = this.findSourceByScope(moduleScope!);\n\t\tconst absoluteUrl = this.resolveURL(source, currentSource);\n\t\treturn this.findScopeBySource(absoluteUrl, importCallOptions);\n\t}\n\tresolveURL(specified: string, parent: string | URL): string {\n\t\tconst currentUrl = parent instanceof URL ? parent.href : createRootURL(parent).href;\n\t\tconst importedUrl = new URL(specified, currentUrl).href;\n\t\tconst absoluteUrl = importedUrl.replace(ROOT_URL, '');\n\t\treturn absoluteUrl;\n\t}\n\tprotected findScopeBySource(source: string, importCallOptions?: ImportCallOptions): ModuleScope {\n\t\tif (importCallOptions?.assert?.type) {\n\t\t\tconst type = importCallOptions.assert.type;\n\t\t\tif (!source.endsWith(`.${type}`)) {\n\t\t\t\tthrow new Error(`Can't find module scope`);\n\t\t\t}\n\t\t}\n\t\tconst importedScope = this.modules.find(tuple => tuple[0] == source)?.[1];\n\t\tif (!importedScope) {\n\t\t\t// search in the file system provider\n\t\t\tconst javascriptSource = this.provider[source];\n\t\t\tif (javascriptSource || javascriptSource == '') {\n\t\t\t\t// module exists\n\t\t\t\tconst moduleProgram = JavaScriptParser.parse(javascriptSource, { mode: LanguageMode.Strict });\n\t\t\t\tconst stack = new Stack(this.globalStack, this, source);\n\t\t\t\t// register with absoluteUrl\n\t\t\t\tthis.register(source, stack.getModule()!);\n\t\t\t\tmoduleProgram.get(stack);\n\t\t\t\treturn stack.getModule()!;\n\t\t\t}\n\t\t\tthrow new Error(`Can't find module scope`);\n\t\t}\n\t\treturn importedScope;\n\t}\n\tprotected findSourceByScope(moduleScope: ModuleScope): string {\n\t\tconst importedSource = this.modules.find(tuple => tuple[1] == moduleScope)?.[0];\n\t\tif (!importedSource) {\n\t\t\tthrow new Error(`Can't resolve scope source`);\n\t\t}\n\t\treturn importedSource;\n\t}\n\tprotected resolveExternalModule(source: string, importCallOptions?: ImportCallOptions): WebModuleScope {\n\t\tif (!this.config?.allowImportExternal) {\n\t\t\tthrow new Error(`Error: Import External Module is not allowed.`);\n\t\t}\n\t\tconst webScope = new WebModuleScope(source, importCallOptions);\n\t\tthis.modules.push([source, webScope]);\n\t\treturn webScope;\n\t}\n\tprotected readonly isValidHTTPUrl = (string: string) => {\n\t\tlet url: URL;\n\t\ttry {\n\t\t\turl = new URL(string);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn url.protocol === 'http:' || url.protocol === 'https:';\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../src/expressions/scope/stack.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACuB,WAAW,EAAE,aAAa,EACvD,oBAAoB,EAAE,KAAK,EAAW,cAAc,EACpD,MAAM,YAAY,CAAC;AAyIpB,MAAM,OAAO,KAAK;IACjB,MAAM,CAAC,GAAG,CAAC,GAAG,QAA0B;QACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,OAAO,IAAI,KAAK,EAAE,CAAC;SACnB;QACD,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,KAAK,CAAU,OAAO,CAAC,CAAC,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,GAAG,MAAwB;QAC3C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;SAChC;QACD,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IACD,MAAM,CAAC,WAAW,CAAC,QAA6B,EAAE,YAAoB,EAAE,GAAG,YAA8B;QACxG,OAAO,IAAI,KAAK,CAAC,YAAY,EAAE,QAAQ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QAAQ,CAAC;IAC9D,CAAC,CAAA;CACD","sourcesContent":["import type { DeclarationExpression } from '../api/expression.js';\nimport { LanguageMode } from '../v8/language.js';\nimport { JavaScriptParser } from '../v8/parser.js';\nimport { finalizerRegister } from './finalizer.js';\nimport {\n\tModuleContext, ModuleImport, ModuleScope, ReactiveScope,\n\tReactiveScopeControl, Scope, Context, WebModuleScope\n} from './scope.js';\n\n\nexport interface AwaitPromiseInfo {\n\tpromise: Promise<any>;\n\tnode: DeclarationExpression;\n\n\tdeclareVariable: boolean;\n}\n\nexport interface AsyncIterableInfo {\n\titerable: AsyncIterable<any>;\n\tforAwaitBody: (iterator: any) => any;\n}\n\nexport interface Stack {\n\t/**\n\t * a list of promises to resolve in an 'async' scope as 'async function'\n\t */\n\tawaitPromise: Array<AwaitPromiseInfo>;\n\n\t/**\n\t * resolve await promise in 'await for in' scope\n\t */\n\tforAwaitAsyncIterable?: AsyncIterableInfo;\n\n\t/**\n\t * is this stack has a propertyKey\n\t * @param propertyKey \n\t */\n\thas(propertyKey: PropertyKey): boolean;\n\n\t/**\n\t * get the first value for provided property key,\n\t * \n\t * will search current stack in all scope till find the first key, else undefined\n\t * @param propertyKey \n\t */\n\tget(propertyKey: PropertyKey): any;\n\n\t/**\n\t * set the value of `propertyKey` in its context provider with `value`.\n\t * else define it in the first scope 'local scope'\n\t * @param propertyKey \n\t * @param value \n\t * @param receiver \n\t */\n\tset(propertyKey: PropertyKey, value: any, receiver?: any): boolean;\n\n\t/**\n\t * declare variable at last scope in the stack,\n\t * \n\t * @param propertyKey the name of property mey be string | number | symbol, \n\t * @param propertyValue if not exist will be initialize with 'undefined' value\n\t */\n\tdeclareVariable(propertyKey: PropertyKey, propertyValue?: any): any;\n\n\n\t/**\n\t * get context object of this provider,\n\t * search for the first context object that has `propertyKey`.\n\t * \n\t * search for the first context that have property key,\n\t * if not found will return the stack local scop as a default value\n\t * @param propertyKey the property key\n\t */\n\tfindScope<T extends Context>(propertyKey: PropertyKey): Scope<T>;\n\n\tresolveAwait(value: AwaitPromiseInfo): void;\n\n\t/**\n\t * get a reference to the last scope in this stack\n\t */\n\tlastScope<T extends Context>(): Scope<T>;\n\n\t/**\n\t * clear every thing after this scope, and even this scope\n\t * @param scope \n\t */\n\tclearTo<T extends Context>(scope: Scope<T>): boolean;\n\n\t/**\n\t * clear every thing after this scope, but not this scope\n\t * @param scope \n\t */\n\tclearTill<T extends Context>(scope: Scope<T>): boolean;\n\n\tpopScope<T extends Context>(): Scope<T>;\n\n\tremoveScope<T extends Context>(scope: Scope<T>): void;\n\n\tpushScope<T extends Context>(scope: Scope<T>): void;\n\n\tpushBlockScope<T extends Context>(): Scope<T>;\n\n\tpushBlockScopeFor<T extends Context>(context: T): Scope<T>;\n\n\tpushReactiveScope<T extends Context>(): ReactiveScope<T>;\n\n\tpushReactiveScopeFor<T extends Context>(context: T): ReactiveScope<T>;\n\n\t/**\n\t * create new stack instance with the same reference to the current scope array\n\t */\n\tcopyStack(): Stack;\n\n\t/**\n\t * used when want to update ui-view like, you want to replace an array with another \n\t * without reflect changes on view until reattached again.\n\t */\n\tdetach(): void;\n\n\t/**\n\t * apply all the not emitted changes, and continue emit in time.\n\t */\n\treattach(): void;\n\n\t/**\n\t * import module scope from another stack, by the help of ModuleScopeResolver.\n\t * \n\t * used with import statement\n\t */\n\timportModule(source: string, importCallOptions?: ImportCallOptions): ModuleScope;\n\n\t/**\n\t * get the current module for this stack.\n\t * \n\t * used with export statement\n\t */\n\tgetModule(): ModuleScope | undefined;\n\n\t/**\n\t * register action to do on destroy this stack\n\t */\n\tonDestroy(action: () => void): void;\n}\n\nexport class Stack implements Stack {\n\tstatic for(...contexts: Scope<Context>[]): Stack {\n\t\tif (contexts.length === 0) {\n\t\t\treturn new Stack();\n\t\t}\n\t\treturn new Stack(contexts.map(context => new Scope<Context>(context)));\n\t}\n\tstatic forScopes(...scopes: Scope<Context>[]): Stack {\n\t\tif (scopes.length === 0) {\n\t\t\tscopes.push(Scope.blockScope());\n\t\t}\n\t\treturn new Stack(scopes);\n\t}\n\tstatic moduleScope(resolver: ModuleScopeResolver, moduleSource: string, ...globalScopes: Scope<Context>[]) {\n\t\treturn new Stack(globalScopes, resolver, moduleSource);\n\t}\n\tawaitPromise: AwaitPromiseInfo[] = [];\n\tforAwaitAsyncIterable?: AsyncIterableInfo | undefined;\n\n\tprotected readonly stack: Array<Scope<any>>;\n\tprotected readonly moduleScope?: ModuleScope;\n\tprotected readonly moduleSource?: string;\n\tprotected readonly resolver?: ModuleScopeResolver;\n\n\tprotected readonly onDestroyActions: (() => void)[] = [];\n\n\tconstructor();\n\tconstructor(globalScope: Scope<Context>);\n\tconstructor(globalScope: Scope<Context>, resolver: ModuleScopeResolver, moduleSource: string);\n\n\tconstructor(stack: Array<Scope<Context>>);\n\tconstructor(stack: Array<Scope<Context>>, resolver: ModuleScopeResolver, moduleSource: string);\n\n\tconstructor(stack: Stack);\n\tconstructor(stack: Stack, resolver: ModuleScopeResolver, moduleSource: string);\n\n\tconstructor(globals?: Stack | Array<Scope<Context>> | Scope<Context>, resolver?: ModuleScopeResolver, moduleSource?: string) {\n\t\tif (Array.isArray(globals)) {\n\t\t\tthis.stack = globals.slice();\n\t\t} else if (globals instanceof Stack) {\n\t\t\tthis.stack = globals.stack.slice();\n\t\t} else if (typeof globals == 'object') {\n\t\t\tthis.stack = [globals];\n\t\t} else {\n\t\t\tthis.stack = [];\n\t\t}\n\t\tif (resolver && moduleSource) {\n\t\t\tthis.resolver = resolver;\n\t\t\tthis.moduleSource = moduleSource;\n\t\t\t// init module scope for import and export\n\t\t\tthis.moduleScope = new ModuleScope(this.initModuleContext());\n\t\t\tthis.pushScope(this.moduleScope);\n\t\t\t// for the rest of module body\n\t\t\tthis.pushReactiveScope();\n\t\t} else if (this.stack.length === 0) {\n\t\t\t// not a module scope\n\t\t\tthis.pushBlockScope();\n\t\t}\n\t\tfinalizerRegister(this, this.onDestroyActions, this);\n\t}\n\tprivate initModuleContext(): ModuleContext {\n\t\tconst importFunc = (path: string) => {\n\t\t\tconst module = this.importModule(path);\n\t\t\tif (module instanceof WebModuleScope) {\n\t\t\t\treturn module.resolveImport();\n\t\t\t}\n\t\t\treturn Promise.resolve(module.getContext());\n\t\t};\n\t\timportFunc.meta = {\n\t\t\turl: createRootURL(this.moduleSource!),\n\t\t\tresolve: (specified: string, parent?: string | URL): Promise<string> => {\n\t\t\t\treturn Promise.resolve(this.resolver!.resolveURL(specified, parent ?? importFunc.meta.url));\n\t\t\t}\n\t\t};\n\t\tconst im: ModuleImport & ((path: string) => Promise<any>) = importFunc as any;\n\t\treturn { import: im };\n\t}\n\thas(propertyKey: PropertyKey): boolean {\n\t\treturn this.stack.find(context => context.has(propertyKey)) ? true : false;\n\t}\n\tget(propertyKey: PropertyKey) {\n\t\treturn this.findScope<Context>(propertyKey).get(propertyKey);\n\t}\n\tset(propertyKey: PropertyKey, value: any, receiver?: any): boolean {\n\t\treturn this.findScope<Context>(propertyKey).set(propertyKey, value, receiver);\n\t}\n\tdeclareVariable(propertyKey: PropertyKey, propertyValue?: any) {\n\t\treturn this.lastScope<Context>().set(propertyKey, propertyValue);\n\t}\n\tfindScope<T extends Context>(propertyKey: PropertyKey): Scope<T> {\n\t\tlet lastIndex = this.stack.length;\n\t\twhile (lastIndex--) {\n\t\t\tconst scope = this.stack[lastIndex];\n\t\t\tif (scope.has(propertyKey)) {\n\t\t\t\treturn scope;\n\t\t\t}\n\t\t}\n\t\treturn this.lastScope();\n\t}\n\tresolveAwait(value: AwaitPromiseInfo): void {\n\t\tthis.awaitPromise.push(value);\n\t}\n\tpopScope<T extends Context>(): Scope<T> {\n\t\treturn this.stack.pop()!;\n\t}\n\tremoveScope<T extends Context>(scope: Scope<T>): void {\n\t\tconst index = this.stack.lastIndexOf(scope);\n\t\tthis.stack.splice(index, 1);\n\t}\n\tpushScope<T extends Context>(scope: Scope<T>): void {\n\t\tthis.stack.push(scope);\n\t}\n\tpushBlockScope<T extends Context>(propertyKeys?: (keyof T)[]): Scope<T> {\n\t\tconst scope = Scope.blockScope<T>(propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushBlockScopeFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]): Scope<T> {\n\t\tconst scope = Scope.for<T>(context, propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushReactiveScope<T extends Context>(propertyKeys?: (keyof T)[]): ReactiveScope<T> {\n\t\tconst scope = ReactiveScope.blockScope<T>(propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tpushReactiveScopeFor<T extends Context>(context: T, propertyKeys?: (keyof T)[]): ReactiveScope<T> {\n\t\tconst scope = ReactiveScope.for(context, propertyKeys);\n\t\tthis.stack.push(scope);\n\t\treturn scope;\n\t}\n\tlastScope<T extends Context>(): Scope<T> {\n\t\treturn this.stack[this.stack.length - 1];\n\t}\n\tclearTo<T extends Context>(scope: Scope<T>): boolean {\n\t\tconst index = this.stack.lastIndexOf(scope);\n\t\tif (index === -1) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.stack.splice(index);\n\t\treturn true;\n\t}\n\tclearTill<T extends Context>(scope: Scope<T>): boolean {\n\t\tconst index = this.stack.lastIndexOf(scope);\n\t\tif (index === -1) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.stack.splice(index + 1);\n\t\treturn true;\n\t}\n\tcopyStack(): Stack {\n\t\treturn new Stack(this.stack.slice(), this.resolver!, this.moduleSource!);\n\t}\n\tdetach(): void {\n\t\tthis.getReactiveScopeControls().forEach(scope => scope.detach());\n\t}\n\treattach(): void {\n\t\tthis.getReactiveScopeControls().forEach(scope => scope.reattach());\n\t}\n\tdetectChanges() {\n\t\tthis.getReactiveScope().forEach(scope => scope.detectChanges());\n\t}\n\tprivate getReactiveScopeControls(): ReactiveScopeControl<any>[] {\n\t\treturn this.stack.filter(scope => scope instanceof ReactiveScopeControl) as ReactiveScopeControl<any>[];\n\t}\n\tprivate getReactiveScope(): ReactiveScope<any>[] {\n\t\treturn this.stack.filter(scope => scope instanceof ReactiveScope) as ReactiveScope<any>[];\n\t}\n\timportModule(source: string, importCallOptions?: ImportCallOptions): ModuleScope {\n\t\tif (!this.resolver || !this.moduleScope) {\n\t\t\t// should o the parse and import the module\n\t\t\tthrow new Error('Module Resolver is undefined');\n\t\t}\n\t\treturn this.resolver.resolve(source, this.moduleScope, importCallOptions);\n\t}\n\tgetModule(): ModuleScope | undefined {\n\t\treturn this.moduleScope;\n\t}\n\n\tonDestroy(action: () => void): void {\n\t\tthis.onDestroyActions.push(action);\n\t}\n}\n\n\nexport interface ModuleScopeResolver {\n\tresolve(source: string, moduleScope: ModuleScope, importCallOptions?: ImportCallOptions): ModuleScope;\n\tresolveURL(specified: string, parent: string | URL): string;\n}\n\nconst ROOT_URL = 'https://root';\nexport function createRootURL(source: string): URL {\n\treturn new URL(source, ROOT_URL);\n}\n\n\nexport interface ResolverConfig {\n\t/**\n\t * allow import modules from external http(s) module\n\t */\n\tallowImportExternal?: boolean;\n\n};\n\n/**\n * file system provider\n */\nexport interface ModuleSourceProvider {\n\t[url: string]: string;\n}\n\nexport class ModuleScopeResolver implements ModuleScopeResolver {\n\tprotected modules: [string, ModuleScope][] = [];\n\n\tconstructor(protected globalStack: Stack, protected provider: ModuleSourceProvider, protected config?: ResolverConfig) { }\n\tprivate register(source: string, moduleScope: ModuleScope) {\n\t\tconst stackInfo = this.modules.find(tuple => tuple[0] == source && tuple[1] == moduleScope);\n\t\tif (stackInfo) {\n\t\t\tstackInfo[1] = moduleScope;\n\t\t} else {\n\t\t\tthis.modules.push([source, moduleScope]);\n\t\t}\n\t}\n\tresolve(source: keyof ModuleSourceProvider): ModuleScope;\n\tresolve(source: keyof ModuleSourceProvider, moduleScope: ModuleScope, importCallOptions?: ImportCallOptions): ModuleScope;\n\tresolve(source: string, moduleScope?: ModuleScope, importCallOptions?: ImportCallOptions): ModuleScope {\n\t\tif (this.isValidHTTPUrl(source)) {\n\t\t\treturn this.resolveExternalModule(source, importCallOptions);\n\t\t}\n\t\tif (source.startsWith('/')) {\n\t\t\treturn this.findScopeBySource(source, importCallOptions);\n\t\t}\n\t\tconst currentSource = this.findSourceByScope(moduleScope!);\n\t\tconst absoluteUrl = this.resolveURL(source, currentSource);\n\t\treturn this.findScopeBySource(absoluteUrl, importCallOptions);\n\t}\n\tresolveURL(specified: string, parent: string | URL): string {\n\t\tconst currentUrl = parent instanceof URL ? parent.href : createRootURL(parent).href;\n\t\tconst importedUrl = new URL(specified, currentUrl).href;\n\t\tconst absoluteUrl = importedUrl.replace(ROOT_URL, '');\n\t\treturn absoluteUrl;\n\t}\n\tprotected findScopeBySource(source: string, importCallOptions?: ImportCallOptions): ModuleScope {\n\t\tif (importCallOptions?.assert?.type) {\n\t\t\tconst type = importCallOptions.assert.type;\n\t\t\tif (!source.endsWith(`.${type}`)) {\n\t\t\t\tthrow new Error(`Can't find module scope`);\n\t\t\t}\n\t\t}\n\t\tconst importedScope = this.modules.find(tuple => tuple[0] == source)?.[1];\n\t\tif (!importedScope) {\n\t\t\t// search in the file system provider\n\t\t\tconst javascriptSource = this.provider[source];\n\t\t\tif (javascriptSource || javascriptSource == '') {\n\t\t\t\t// module exists\n\t\t\t\tconst moduleProgram = JavaScriptParser.parse(javascriptSource, { mode: LanguageMode.Strict });\n\t\t\t\tconst stack = new Stack(this.globalStack, this, source);\n\t\t\t\t// register with absoluteUrl\n\t\t\t\tthis.register(source, stack.getModule()!);\n\t\t\t\tmoduleProgram.get(stack);\n\t\t\t\treturn stack.getModule()!;\n\t\t\t}\n\t\t\tthrow new Error(`Can't find module scope`);\n\t\t}\n\t\treturn importedScope;\n\t}\n\tprotected findSourceByScope(moduleScope: ModuleScope): string {\n\t\tconst importedSource = this.modules.find(tuple => tuple[1] == moduleScope)?.[0];\n\t\tif (!importedSource) {\n\t\t\tthrow new Error(`Can't resolve scope source`);\n\t\t}\n\t\treturn importedSource;\n\t}\n\tprotected resolveExternalModule(source: string, importCallOptions?: ImportCallOptions): WebModuleScope {\n\t\tif (!this.config?.allowImportExternal) {\n\t\t\tthrow new Error(`Error: Import External Module is not allowed.`);\n\t\t}\n\t\tconst webScope = new WebModuleScope(source, importCallOptions);\n\t\tthis.modules.push([source, webScope]);\n\t\treturn webScope;\n\t}\n\tprotected readonly isValidHTTPUrl = (string: string) => {\n\t\tlet url: URL;\n\t\ttry {\n\t\t\turl = new URL(string);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t\treturn url.protocol === 'http:' || url.protocol === 'https:';\n\t}\n}\n"]}
|
package/v8/enums.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/expressions/v8/enums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAEhE;AAED,oBAAY,oBAAoB;IAAG,qBAAqB,IAAA;IAAE,cAAc,IAAA;IAAE,kBAAkB,IAAA;CAAE;AAC9F,oBAAY,YAAY;IACvB,KAAK,IAAA;IAAE,SAAS,IAAA;IAAE,qBAAqB,IAAA;IACvC,MAAM,IAAA;IAAE,MAAM,IAAA;IAAE,UAAU,IAAA;IAAE,cAAc,IAAA;IAAE,cAAc,IAAA;IAC1D,MAAM,IAAA;IAAE,MAAM,IAAA;CACd;AACD,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,WAE5C;AAED,oBA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ACvB,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAE3B,kBAAkB,EAAE,MAAM,CAAC;IAE3B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,wBAAwB,CAAC,EAAE,kBAAkB,CAAC;CAC9C,CAAC;AAEF,wBAAgB,eAAe,IAAI,SAAS,CAoB3C;AAED,oBAAY,oBAAoB;IAC/B,4BAA4B,iCAAiC;IAC7D,qBAAqB,0BAA0B;IAC/C,2BAA2B,gCAAgC;CAC3D;AAED,oBAAY,yBAAyB;IACpC,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,oBAAoB,yBAAyB;IAC7C,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,MAAM,WAAW;CACjB;AACD,qBAAa,qBAAqB;IACjC,MAAM,CAAC,IAAI,mCAA6B;CACxC;AAED,oBAAY,wBAAwB;IACnC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;CACf;AAED,qBAAa,oBAAoB;IAChC,MAAM,CAAC,IAAI,kCAA4B;CACvC;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,GAAG,wBAAwB,CAYjF;AAED,oBAAY,YAAY;IACvB,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;CACvC;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,wBAAwB,GAAG,YAAY,CAW5E;AAED,oBAAY,0BAA0B;IACrC,iBAAiB,IAAA;IACjB,SAAS,IAAA;IACT,YAAY,IAAA;CACZ;AAED,oBAAY,8BAA8B;IACzC,8BAA8B,IAAA;IAC9B,iCAAiC,IAAA;CACjC"}
|
package/v8/enums.js
CHANGED
|
@@ -30,15 +30,15 @@ export var PropertyPosition;
|
|
|
30
30
|
PropertyPosition[PropertyPosition["ClassLiteral"] = 1] = "ClassLiteral";
|
|
31
31
|
})(PropertyPosition || (PropertyPosition = {}));
|
|
32
32
|
export class PropertyKindInfo {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
name;
|
|
34
|
+
position = PropertyPosition.ClassLiteral;
|
|
35
|
+
funcFlag = ParseFunctionFlag.IsNormal;
|
|
36
|
+
kind = PropertyKind.NotSet;
|
|
37
|
+
isComputedName = false;
|
|
38
|
+
isPrivate = false;
|
|
39
|
+
isStatic = false;
|
|
40
|
+
isRest = false;
|
|
41
|
+
rangeStart;
|
|
42
42
|
parsePropertyKindFromToken(token) {
|
|
43
43
|
// This returns true, setting the property kind, iff the given token is
|
|
44
44
|
// one which must occur after a property name, indicating that the
|
|
@@ -331,8 +331,8 @@ export var ObjectLiteralPropertyKind;
|
|
|
331
331
|
ObjectLiteralPropertyKind["SPREAD"] = "SPREAD";
|
|
332
332
|
})(ObjectLiteralPropertyKind || (ObjectLiteralPropertyKind = {}));
|
|
333
333
|
export class ObjectLiteralProperty {
|
|
334
|
+
static Kind = ObjectLiteralPropertyKind;
|
|
334
335
|
}
|
|
335
|
-
ObjectLiteralProperty.Kind = ObjectLiteralPropertyKind;
|
|
336
336
|
export var ClassLiteralPropertyKind;
|
|
337
337
|
(function (ClassLiteralPropertyKind) {
|
|
338
338
|
ClassLiteralPropertyKind["METHOD"] = "METHOD";
|
|
@@ -341,8 +341,8 @@ export var ClassLiteralPropertyKind;
|
|
|
341
341
|
ClassLiteralPropertyKind["FIELD"] = "FIELD";
|
|
342
342
|
})(ClassLiteralPropertyKind || (ClassLiteralPropertyKind = {}));
|
|
343
343
|
export class ClassLiteralProperty {
|
|
344
|
+
static Kind = ClassLiteralPropertyKind;
|
|
344
345
|
}
|
|
345
|
-
ClassLiteralProperty.Kind = ClassLiteralPropertyKind;
|
|
346
346
|
export function classPropertyKindFor(kind) {
|
|
347
347
|
switch (kind) {
|
|
348
348
|
case PropertyKind.AccessorGetter:
|