diff --git a/ui2abc/memo-plugin/src/transform/ParameterTransformer.ts b/ui2abc/memo-plugin/src/transform/BodiesTransformer.ts similarity index 42% rename from ui2abc/memo-plugin/src/transform/ParameterTransformer.ts rename to ui2abc/memo-plugin/src/transform/BodiesTransformer.ts index 23efed45002a1f05570db2292f38ce1720e7f42d..ec8eaeb33bc1ded676da8de0de454f1a72b5fed5 100644 --- a/ui2abc/memo-plugin/src/transform/ParameterTransformer.ts +++ b/ui2abc/memo-plugin/src/transform/BodiesTransformer.ts @@ -24,22 +24,35 @@ export type ParamInfo = { param: arkts.ETSParameterExpression } -export class ParameterTransformer extends arkts.AbstractVisitor { - private rewriteIdentifiers?: Map arkts.MemberExpression | arkts.Identifier> +export interface BodiesTransformerOptions { + transformParameters: boolean, + transformInternals: boolean, + transformReturns: boolean, +} + +export const fullBodiesTransfomerOptions = { transformParameters: true, transformInternals: true, transformReturns: true } +export const partBodiesTransfomerOptions = { transformParameters: false, transformInternals: true, transformReturns: false } + +/** + * This complex transformation is a combination of parameters transformation, returns transformation and internals transformation + * + * It seems that in current reality, visiting AST is one of the most expensive things expect recheck + */ +export class BodiesTransformer extends arkts.AbstractVisitor { + private rewriteIdentifiers?: Map arkts.MemberExpression> private rewriteCalls?: Map arkts.CallExpression> private rewriteThis?: boolean - private skipNode?: arkts.VariableDeclaration constructor(private positionalIdTracker: PositionalIdTracker) { super() } - withThis(flag: boolean): ParameterTransformer { + withThis(flag: boolean): BodiesTransformer { this.rewriteThis = flag return this } - withParameters(parameters: ParamInfo[]): ParameterTransformer { + withParameters(parameters: ParamInfo[]): BodiesTransformer { this.rewriteCalls = new Map(parameters.filter(it => it.param.typeAnnotation && (arkts.isETSFunctionType(it.param.typeAnnotation) || arkts.isETSUnionType(it.param.typeAnnotation))).map(it => { return [it.param.ident!.name.startsWith(RuntimeNames.GENSYM) ? it.ident.originalPeer : it.param.originalPeer, (passArgs: arkts.Expression[]) => { @@ -56,40 +69,71 @@ export class ParameterTransformer extends arkts.AbstractVisitor { return this } - skip(memoParametersDeclaration?: arkts.VariableDeclaration): ParameterTransformer { - this.skipNode = memoParametersDeclaration - return this - } - - visitor(beforeChildren: arkts.AstNode): arkts.AstNode { - if (beforeChildren === this.skipNode) { - return beforeChildren - } + visitor(beforeChildren: arkts.BlockStatement, options: BodiesTransformerOptions): arkts.BlockStatement + visitor(beforeChildren: arkts.Expression, options: BodiesTransformerOptions): arkts.Expression + visitor(beforeChildren: arkts.ReturnStatement, options: BodiesTransformerOptions): arkts.ReturnStatement + visitor(beforeChildren: arkts.AstNode, options: BodiesTransformerOptions): arkts.AstNode { + // This is about default parameter assignments, they are generated by compiler, don't go into them at all if (arkts.isVariableDeclaration(beforeChildren) && this.rewriteIdentifiers?.has(beforeChildren.declarators[0].id!.originalPeer)) { return beforeChildren } - if (arkts.isCallExpression(beforeChildren)) { - if (arkts.isIdentifier(beforeChildren.callee)) { + + if (arkts.isCallExpression(beforeChildren) && arkts.isIdentifier(beforeChildren.callee)) { + if (options.transformInternals) { + if (beforeChildren.callee.name == RuntimeNames.__CONTEXT) { + return arkts.factory.createIdentifier(RuntimeNames.CONTEXT) + } + if (beforeChildren.callee.name == RuntimeNames.__ID) { + return arkts.factory.createIdentifier(RuntimeNames.ID) + } + if (beforeChildren.callee.name == RuntimeNames.__KEY) { + return this.positionalIdTracker.id(RuntimeNames.__KEY) + } + } + if (options.transformParameters) { const decl = arkts.getPeerDecl(beforeChildren.callee.originalPeer) // Improve: here should be getDeclResolveGensym, but it would result in code not passing filterSource if (decl && this.rewriteCalls?.has(decl.originalPeer)) { return this.rewriteCalls.get(decl.originalPeer)!( - beforeChildren.arguments.map((it) => this.visitor(it) as arkts.Expression) // Improve: remove as + beforeChildren.arguments.map((it) => this.visitor(it, options)) ) } } } - const node = this.visitEachChild(beforeChildren) - if (arkts.isIdentifier(node)) { - const decl = arkts.getPeerDecl(node.originalPeer) // Improve: here should be getDeclResolveGensym, but it would result in code not passing filterSource - if (decl && this.rewriteIdentifiers?.has(decl.originalPeer)) { - return this.rewriteIdentifiers.get(decl.originalPeer)!() + + const node = this.visitEachChild(beforeChildren, { + transformParameters: options.transformParameters, + transformReturns: options.transformReturns && !arkts.isScriptFunction(beforeChildren), + transformInternals: options.transformInternals && !arkts.isScriptFunction(beforeChildren), + }) + + if (options.transformParameters) { + if (arkts.isIdentifier(node)) { + const decl = arkts.getPeerDecl(node.originalPeer) // Improve: here should be getDeclResolveGensym, but it would result in code not passing filterSource + if (decl && this.rewriteIdentifiers?.has(decl.originalPeer)) { + return this.rewriteIdentifiers.get(decl.originalPeer)!() + } + } + if (arkts.isThisExpression(node) && this.rewriteThis) { + if (!arkts.isReturnStatement(node.parent)) { + return factory.createMemoParameterAccess(RuntimeNames.THIS) + } } } - if (arkts.isThisExpression(node) && this.rewriteThis) { - if (arkts.isReturnStatement(node.parent)) { - return node + if (options.transformReturns && arkts.isReturnStatement(node)) { + if (node.argument == undefined || arkts.isThisExpression(node.argument)) { + return arkts.factory.createBlockStatement([ + arkts.factory.createExpressionStatement( + factory.createRecacheCall() + ), + node, + ]) } - return factory.createMemoParameterAccess(RuntimeNames.THIS) + node.setArgument(factory.createRecacheCall(this.visitor(node.argument, { + transformParameters: options.transformParameters, + transformReturns: options.transformReturns, + transformInternals: options.transformInternals, + }))) + return node } return node } diff --git a/ui2abc/memo-plugin/src/transform/FunctionTransformer.ts b/ui2abc/memo-plugin/src/transform/FunctionTransformer.ts index 759fd8107902e6c50956f7b475e03afe925966f3..3bdf69178dd3aa00d322d8ce7de45fbe2f7bfb6c 100644 --- a/ui2abc/memo-plugin/src/transform/FunctionTransformer.ts +++ b/ui2abc/memo-plugin/src/transform/FunctionTransformer.ts @@ -20,10 +20,6 @@ import { moveToFront, parametersBlockHasReceiver, } from "./utils" -import { ParameterTransformer, ParamInfo } from "./ParameterTransformer" -import { ReturnTransformer } from "./ReturnTranformer" -import { InternalsTransformer } from "./InternalsTransformer" -import { SignatureTransformer } from "./SignatureTransformer" import { castParameters, hasMemoStableAnnotation, @@ -41,6 +37,8 @@ import { MemoPluginContext, RuntimeNames } from "../common" +import { rewriteSignature } from "./SignatureTransformer" +import { BodiesTransformer, fullBodiesTransfomerOptions, ParamInfo, partBodiesTransfomerOptions } from "./BodiesTransformer" function needThisRewrite(hasReceiver: boolean, isStatic: boolean, stableThis: boolean) { return hasReceiver && !isStatic && !stableThis @@ -88,23 +86,14 @@ function fixGensymParams(params: ParamInfo[], body: arkts.BlockStatement) { function updateFunctionBody( node: arkts.BlockStatement, - parameters: readonly arkts.ETSParameterExpression[], + parameterIdentifiers: ParamInfo[], + gensymParamsCount: number, returnTypeAnnotation: arkts.TypeNode | undefined, - hasReceiver: boolean, - isStatic: boolean, + shouldCreateMemoThisParam: boolean, stableThis: boolean, hash: arkts.Expression, addLogging: boolean, - trackContentParam: boolean, -): [ - arkts.BlockStatement, - ParamInfo[], - arkts.VariableDeclaration | undefined, - arkts.ReturnStatement | arkts.BlockStatement | undefined, -] { - const shouldCreateMemoThisParam = needThisRewrite(hasReceiver, isStatic, stableThis) && !parametersBlockHasReceiver(parameters) - const parameterIdentifiers = getMemoParameterIdentifiers(parameters, trackContentParam) - const gensymParamsCount = fixGensymParams(parameterIdentifiers, node) +): arkts.BlockStatement { const parameterNames = [...(shouldCreateMemoThisParam ? [RuntimeNames.THIS.valueOf()] : []), ...parameterIdentifiers.map(it => it.ident.name)] const scopeDeclaration = factory.createScopeDeclaration( arkts.isTSThisType(returnTypeAnnotation) ? undefined : returnTypeAnnotation, @@ -126,25 +115,16 @@ function updateFunctionBody( ...unchangedCheck, ...thisParamSubscription, ...node.statements.slice(gensymParamsCount), - ...(mayAddLastReturn(node) ? [arkts.factory.createReturnStatement(undefined)] : []), ] ) - return [ - node, - parameterIdentifiers, - memoParametersDeclaration, - syntheticReturnStatement, - ] + return node } export class FunctionTransformer extends arkts.AbstractVisitor { constructor( private memoPluginContext: MemoPluginContext, private positionalIdTracker: PositionalIdTracker, - private signatureTransformer: SignatureTransformer, - private internalsTransformer: InternalsTransformer, - private parameterTransformer: ParameterTransformer, - private returnTransformer: ReturnTransformer, + private bodiesTransformer: BodiesTransformer, private addLogging: boolean, private trackContentParam: boolean, ) { @@ -171,55 +151,50 @@ export class FunctionTransformer extends arkts.AbstractVisitor { return this } - updateScriptFunction( + transformScriptFunction( scriptFunction: arkts.ScriptFunction, - name: string = "", ): arkts.ScriptFunction { - if (!scriptFunction.body || !arkts.isBlockStatement(scriptFunction.body)) { - return scriptFunction - } const kind = this.memoPluginContext.ScriptFunctionKinds.get(scriptFunction.original) if (!kind) { return scriptFunction } - const afterInternalsTransformer = this.internalsTransformer.visitor(scriptFunction.body) as arkts.BlockStatement + const body = scriptFunction.body + if (!arkts.isBlockStatement(body)) { + return rewriteSignature(scriptFunction, kind) + } if (!functionHasFullBodyTransformation(kind)) { - scriptFunction.setBody(afterInternalsTransformer) - return scriptFunction + scriptFunction.setBody( + this.bodiesTransformer + .withParameters([]) + .withThis(false) + .visitor(body, partBodiesTransfomerOptions) + ) + return rewriteSignature(scriptFunction, kind) } const hasReceiver = functionHasReceiver(kind) const isStatic = (scriptFunction.modifierFlags & arkts.Es2pandaModifierFlags.MODIFIER_FLAGS_STATIC) != 0 const isStableThis = this.stable > 0 - const [body, parameterIdentifiers, memoParametersDeclaration, syntheticReturnStatement] = updateFunctionBody( - afterInternalsTransformer, - castParameters(scriptFunction.params), + if (mayAddLastReturn(body)) { + body.addStatement(arkts.factory.createReturnStatement(undefined)) + } + const parameters = castParameters(scriptFunction.params) + const parameterIdentifiers = getMemoParameterIdentifiers(parameters, this.trackContentParam) + const gensymParamsCount = fixGensymParams(parameterIdentifiers, body) + const afterBodiesTransformer = this.bodiesTransformer + .withThis(needThisRewrite(hasReceiver, isStatic, isStableThis)) + .withParameters(parameterIdentifiers) + .visitor(body, fullBodiesTransfomerOptions) + updateFunctionBody( + afterBodiesTransformer, + parameterIdentifiers, + gensymParamsCount, getReturnTypeAnnotation(scriptFunction), - hasReceiver, - isStatic, + needThisRewrite(hasReceiver, isStatic, isStableThis) && !parametersBlockHasReceiver(parameters), isStableThis, - this.positionalIdTracker.id(name), + this.positionalIdTracker.id(), this.addLogging, - this.trackContentParam, - ) - const afterParameterTransformer = this.parameterTransformer - .withThis(needThisRewrite(hasReceiver, isStatic, isStableThis)) - .withParameters(parameterIdentifiers) - .skip(memoParametersDeclaration) - .visitor(body) - const afterReturnTransformer = this.returnTransformer - .skip(syntheticReturnStatement) - .visitor(afterParameterTransformer) - scriptFunction.setBody(afterReturnTransformer) - return scriptFunction - } - - transformScriptFunction(node: arkts.ScriptFunction): arkts.ScriptFunction { - return this.signatureTransformer.visitor( - this.updateScriptFunction( - node, - node.id?.name, - ) ) + return rewriteSignature(scriptFunction, kind) } transformCallExpression(node: arkts.CallExpression): arkts.CallExpression { @@ -251,7 +226,7 @@ export class FunctionTransformer extends arkts.AbstractVisitor { } transformETSFunctionType(node: arkts.ETSFunctionType): arkts.ETSFunctionType { - return this.signatureTransformer.visitor(node) + return rewriteSignature(node, this.memoPluginContext.ETSFunctionTypeKinds.get(node.original)) } visitor(beforeChildren: arkts.ETSModule): arkts.ETSModule diff --git a/ui2abc/memo-plugin/src/transform/InternalsTransformer.ts b/ui2abc/memo-plugin/src/transform/InternalsTransformer.ts deleted file mode 100644 index fa8a9d9d455a16524b8263092286bae912952a17..0000000000000000000000000000000000000000 --- a/ui2abc/memo-plugin/src/transform/InternalsTransformer.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as arkts from "@koalaui/libarkts" -import { RuntimeNames } from "../common" -import { PositionalIdTracker } from "./utils" - -export class InternalsTransformer extends arkts.AbstractVisitor { - constructor(private positionalIdTracker: PositionalIdTracker) { - super() - } - - visitor(beforeChildren: arkts.AstNode): arkts.AstNode { - const node = this.visitEachChild(beforeChildren) - if (arkts.isCallExpression(node)) { - if (arkts.isIdentifier(node.callee)) { - if (node.callee.name == RuntimeNames.__CONTEXT) { - return arkts.factory.createIdentifier( - RuntimeNames.CONTEXT, - undefined - ) - } - if (node.callee.name == RuntimeNames.__ID) { - return arkts.factory.createIdentifier( - RuntimeNames.ID, - undefined - ) - } - if (node.callee.name == RuntimeNames.__KEY) { - return this.positionalIdTracker.id(RuntimeNames.__KEY) - } - } - } - return node - } -} diff --git a/ui2abc/memo-plugin/src/transform/MemoTransformer.ts b/ui2abc/memo-plugin/src/transform/MemoTransformer.ts index 5884e0c46b133cc53ced32d047ea3408af69ce87..0a070018460b4d72abb27bb8c0808941509e57f2 100644 --- a/ui2abc/memo-plugin/src/transform/MemoTransformer.ts +++ b/ui2abc/memo-plugin/src/transform/MemoTransformer.ts @@ -16,10 +16,7 @@ import * as arkts from "@koalaui/libarkts" import { FunctionTransformer } from "./FunctionTransformer" import { dumpAstToFile, PositionalIdTracker } from "./utils" -import { InternalsTransformer } from "./InternalsTransformer" -import { ParameterTransformer } from "./ParameterTransformer" -import { ReturnTransformer } from "./ReturnTranformer" -import { SignatureTransformer } from "./SignatureTransformer" +import { BodiesTransformer } from "./BodiesTransformer" import { MEMO_PLUGIN_CONTEXT_PARAMETER_NAME, MemoPluginContext, TransformerOptions } from "../common" export function checkedRewriteTransformer( @@ -32,20 +29,14 @@ export function checkedRewriteTransformer( } const positionalIdTracker = new PositionalIdTracker(program.relativeFilePath, userPluginOptions?.stableForTests) - const signatureTransformer = new SignatureTransformer(memoPluginContext) - const internalsTransformer = new InternalsTransformer(positionalIdTracker) - const parameterTransformer = new ParameterTransformer(positionalIdTracker) - const returnTransformer = new ReturnTransformer() + const bodiesTransformer = new BodiesTransformer(positionalIdTracker) const node = program.ast as arkts.ETSModule const functionTransformer = new FunctionTransformer( memoPluginContext, positionalIdTracker, - signatureTransformer, - internalsTransformer, - parameterTransformer, - returnTransformer, + bodiesTransformer, userPluginOptions?.addLogging ?? false, userPluginOptions?.trackContentParam ?? false, ) diff --git a/ui2abc/memo-plugin/src/transform/ReturnTranformer.ts b/ui2abc/memo-plugin/src/transform/ReturnTranformer.ts deleted file mode 100644 index 37e3e3694db73e67060f8216467ecb79c0d9b79c..0000000000000000000000000000000000000000 --- a/ui2abc/memo-plugin/src/transform/ReturnTranformer.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as arkts from "@koalaui/libarkts" -import { factory } from "../MemoFactory" - -/** - * This transformer corrects function's body according to memo transformation - */ -export class ReturnTransformer extends arkts.AbstractVisitor { - private skipNode?: arkts.ReturnStatement | arkts.BlockStatement - - skip(syntheticReturnStatement?: arkts.ReturnStatement | arkts.BlockStatement): ReturnTransformer { - this.skipNode = syntheticReturnStatement - return this - } - - visitor(beforeChildren: arkts.AstNode): arkts.AstNode { - if (beforeChildren === this.skipNode) { - return beforeChildren - } - if (arkts.isScriptFunction(beforeChildren)) { - return beforeChildren - } - const node = this.visitEachChild(beforeChildren) - if (arkts.isReturnStatement(node)) { - if (node.argument == undefined || arkts.isThisExpression(node.argument)) { - return arkts.factory.createBlockStatement([ - arkts.factory.createExpressionStatement( - factory.createRecacheCall() - ), - node - ]) - } - node.setArgument(factory.createRecacheCall(node.argument)) - return node - } - return node - } -} diff --git a/ui2abc/memo-plugin/src/transform/SignatureTransformer.ts b/ui2abc/memo-plugin/src/transform/SignatureTransformer.ts index 9ac921491c00f8798918a11cbcd8e084582a636c..e1084e96f2014e81ccc80847a0c82a223b4da1f8 100644 --- a/ui2abc/memo-plugin/src/transform/SignatureTransformer.ts +++ b/ui2abc/memo-plugin/src/transform/SignatureTransformer.ts @@ -18,11 +18,11 @@ import { moveToFront, parametersBlockHasReceiver, } from "./utils" -import { MemoFunctionKind, MemoPluginContext } from "../common" -import { castParameters } from "../api-utils" +import { functionSupportsParametersRewrite, MemoFunctionKind } from "../common" +import { assertIsNever, castParameters } from "../api-utils" import { factory } from "../MemoFactory" -export function extendParameters(params: readonly arkts.ETSParameterExpression[], hasReceiverHint: boolean) { +function extendParameters(params: readonly arkts.ETSParameterExpression[], hasReceiverHint: boolean) { let newParams = [...factory.createHiddenParameters(), ...params] if (hasReceiverHint && parametersBlockHasReceiver(params)) { newParams = moveToFront(newParams, 2) @@ -30,52 +30,32 @@ export function extendParameters(params: readonly arkts.ETSParameterExpression[] return newParams } -export class SignatureTransformer extends arkts.AbstractVisitor { - constructor( - private memoPluginContext: MemoPluginContext, - ) { - super() +export function rewriteSignature(node: T, kind?: MemoFunctionKind): T { + if (!functionSupportsParametersRewrite(kind)) { + return node } - - visitor(node: arkts.ScriptFunction): arkts.ScriptFunction - visitor(node: arkts.ETSFunctionType): arkts.ETSFunctionType - visitor(node: arkts.AstNode): arkts.AstNode { - if (arkts.isScriptFunction(node)) { - const kind = this.memoPluginContext.ScriptFunctionKinds.get(node.original) - const shouldTransform = kind == MemoFunctionKind.MEMO || kind == MemoFunctionKind.INTRINSIC - || kind == MemoFunctionKind.MEMO_WITH_RECEIVER || kind == MemoFunctionKind.INTRINSIC_WITH_RECEIVER - if (!shouldTransform) { - return node - } - node.setParams( - extendParameters( - castParameters(node.params), - kind == MemoFunctionKind.MEMO_WITH_RECEIVER || kind == MemoFunctionKind.INTRINSIC_WITH_RECEIVER - ) - ) - return node - } - if (arkts.isETSFunctionType(node)) { - const kind = this.memoPluginContext.ETSFunctionTypeKinds.get(node.original) - const shouldTransform = kind == MemoFunctionKind.MEMO || kind == MemoFunctionKind.INTRINSIC - || kind == MemoFunctionKind.MEMO_WITH_RECEIVER || kind == MemoFunctionKind.INTRINSIC_WITH_RECEIVER - if (!shouldTransform) { - return node - } - return arkts.factory.updateETSFunctionType( - node, - node.typeParams, - extendParameters( - castParameters(node.params), - kind == MemoFunctionKind.MEMO_WITH_RECEIVER || kind == MemoFunctionKind.INTRINSIC_WITH_RECEIVER - ), - node.returnType, - node.isExtensionFunction, - node.flags, - node.annotations, + if (arkts.isScriptFunction(node)) { + node.setParams( + extendParameters( + castParameters(node.params), + kind == MemoFunctionKind.MEMO_WITH_RECEIVER || kind == MemoFunctionKind.INTRINSIC_WITH_RECEIVER ) - } - - return this.visitEachChild(node) + ) + return node + } + if (arkts.isETSFunctionType(node)) { + return arkts.factory.updateETSFunctionType( + node, + node.typeParams, + extendParameters( + castParameters(node.params), + kind == MemoFunctionKind.MEMO_WITH_RECEIVER || kind == MemoFunctionKind.INTRINSIC_WITH_RECEIVER + ), + node.returnType, + node.isExtensionFunction, + node.flags, + node.annotations, + ) as T } + assertIsNever(node) } diff --git a/ui2abc/memo-plugin/test/golden/HQ/abstract.ets b/ui2abc/memo-plugin/test/golden/HQ/abstract.ets index 022466b1a2380425fd41129f1c62765e7faa2967..934a6207707602829c5f7e0aceb32134a76cfea8 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/abstract.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/abstract.ets @@ -17,7 +17,7 @@ declare abstract class A { class AA extends A { @memo() public x(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_x_abstract.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__abstract.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/arrow-assignment.ets b/ui2abc/memo-plugin/test/golden/HQ/arrow-assignment.ets index e280e65785dba3ae3b31383d775a40b819a50d1f..a214ea128cad46eab872aad3ba298dfa612dc671 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/arrow-assignment.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/arrow-assignment.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public memo_variables(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_variables_arrow-assignment.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__arrow-assignment.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/call-type.ets b/ui2abc/memo-plugin/test/golden/HQ/call-type.ets index 8aae4c634fa98dc9e911cb3999dbe181f2c4a522..7973f387d4589e61b0a85cd360c9621c6e272a37 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/call-type.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/call-type.ets @@ -10,7 +10,7 @@ type MemoType = @memo() ((__memo_context: __memo_context_type, __memo_id: __memo class Test { @memo() public type_alias(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: MemoType) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_type_alias_call-type.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__call-type.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/compute.ets b/ui2abc/memo-plugin/test/golden/HQ/compute.ets index 73ca6ac48e8bfd6b433f53a6e92d9c0c0e1a5966..cb2b203abebf878330d87ef7d38644f8c783f27b 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/compute.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/compute.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public compute_test(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() arg1: (((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined), arg2: ((()=> void) | undefined), content: ((()=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_compute_test_compute.ets"))), 3); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__compute.ets"))), 3); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg1 = __memo_scope.param(1, arg1), __memo_parameter_arg2 = __memo_scope.param(2, arg2); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_compute.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__compute.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/content-usage.ets b/ui2abc/memo-plugin/test/golden/HQ/content-usage.ets index dfa8d0a3ab15435d4ff1c1828af23b21a9b53ce6..79c39c88e2bf93e8e91066320e915e9cbea5ec1a 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/content-usage.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/content-usage.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public memo_content(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() content: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_content_content-usage.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__content-usage.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/entry.ets b/ui2abc/memo-plugin/test/golden/HQ/entry.ets index 0d663d707dc7608f9802a7c0d1e44c592ef318e6..bbfe5c3aa04bfacf81a20834f090dab65fa982bf 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/entry.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/entry.ets @@ -11,10 +11,10 @@ function main() {} class Test { @memo_entry() public memoEntry(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() entry: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> R)): R { const getContext = (() => { - return __memo_context; + return __context(); }); const getId = (() => { - return __memo_id; + return __id(); }); { const __memo_context = getContext(); diff --git a/ui2abc/memo-plugin/test/golden/HQ/implicit-void-method.ets b/ui2abc/memo-plugin/test/golden/HQ/implicit-void-method.ets index 29204a7954c9a01d4d6250172436e783e0639611..d277f19215f33f1c2edc4e74c350f4b2c9f92aa7 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/implicit-void-method.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/implicit-void-method.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public a_method_with_implicit_return_type(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_a_method_with_implicit_return_type_implicit-void-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__implicit-void-method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/instantiate.ets b/ui2abc/memo-plugin/test/golden/HQ/instantiate.ets index c7118c42a77833a82dd0832c8be18916d8b60a0d..7bb26fb9af1891be815dd6cd03ccadd15a269693 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/instantiate.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/instantiate.ets @@ -8,7 +8,7 @@ function main() {} class C { @memo() public static $_instantiate(__memo_context: __memo_context_type, __memo_id: __memo_id_type, factory: (()=> C)): C { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_$_instantiate_instantiate.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__instantiate.ets"))), 1); const __memo_parameter_factory = __memo_scope.param(0, factory); if (__memo_scope.unchanged) { return __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/internal-call.ets b/ui2abc/memo-plugin/test/golden/HQ/internal-call.ets index a25c37051fccc7ccf5455452bcb9e9b17d6be81f..c4130ca93496e80af711e059501015d6422a708c 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/internal-call.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/internal-call.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public void_method(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_internal-call.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__internal-call.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -21,7 +21,7 @@ class Test { } @memo() public internal_call(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_internal_call_internal-call.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__internal-call.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/internals.ets b/ui2abc/memo-plugin/test/golden/HQ/internals.ets index 168406678140bb56e0458dca5b965952692d12ee..e1ffb33f256090dabf6b2187eb936cd8a9e6f760 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/internals.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/internals.ets @@ -10,7 +10,7 @@ function main() {} class Test { @memo() public method_with_internals(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_method_with_internals_internals.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__internals.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/intrinsic-call.ets b/ui2abc/memo-plugin/test/golden/HQ/intrinsic-call.ets index 0f96aa0cf9c6f1cc42f005f6ad0405e3f8b7b993..ed4527579637312ecac5ad56cc8ee4cb3df35a29 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/intrinsic-call.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/intrinsic-call.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public void_method(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_intrinsic-call.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__intrinsic-call.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/invoke.ets b/ui2abc/memo-plugin/test/golden/HQ/invoke.ets index b9d48d4366923218b6c3284a6d04e7aa344b9f49..44a16e159f43e748c83d69e5f06c4b5a468f58d7 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/invoke.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/invoke.ets @@ -8,7 +8,7 @@ function main() {} class A { @memo() public static $_invoke(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_$_invoke_invoke.ets"))), 0); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__invoke.ets"))), 0); if (__memo_scope.unchanged) { __memo_scope.cached; return; diff --git a/ui2abc/memo-plugin/test/golden/HQ/memo-property-type.ets b/ui2abc/memo-plugin/test/golden/HQ/memo-property-type.ets index 3286e71de97795f600fe6b3159c736e249f4db02..3eded753c9680ae51d0dd1b41cb9eaade895d49e 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/memo-property-type.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/memo-property-type.ets @@ -14,7 +14,7 @@ class A { } @memo() public build(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_build_memo-property-type.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-property-type.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/memo-property.ets b/ui2abc/memo-plugin/test/golden/HQ/memo-property.ets index a455276f3f4b839cf39b07c18a58b16bc6da059c..a99aa2f1e38cf549796e9b3031b6638a5d13edb7 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/memo-property.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/memo-property.ets @@ -14,7 +14,7 @@ class A { } @memo() public build(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_build_memo-property.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-property.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/non-memo-property.ets b/ui2abc/memo-plugin/test/golden/HQ/non-memo-property.ets index f6bab57e89f1e49fe5281fce3db14eae9c086791..0c787dc573b7429a895882f6fed28303081919a3 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/non-memo-property.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/non-memo-property.ets @@ -14,7 +14,7 @@ class A { } @memo() public build(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_build_non-memo-property.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__non-memo-property.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/object-param.ets b/ui2abc/memo-plugin/test/golden/HQ/object-param.ets index c12f49812ee1b45254ab3ed35cd747a7eca2af84..c812063c4fe1846d353ebc9c1eaceb0b47759fc5 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/object-param.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/object-param.ets @@ -17,7 +17,7 @@ class A { class Test { @memo() public obj_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: A) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_obj_arg_object-param.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__object-param.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -35,7 +35,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_object-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__object-param.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/param-calls-optional.ets b/ui2abc/memo-plugin/test/golden/HQ/param-calls-optional.ets index e423701033f26d10819b0a2df2de56326ab8709c..07bf225676e133eca5d2b7fc9f952d05b4273b61 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/param-calls-optional.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/param-calls-optional.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public optional_args(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg1?: int, arg2?: (()=> int)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_optional_args_param-calls-optional.ets"))), 3); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__param-calls-optional.ets"))), 3); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg1 = __memo_scope.param(1, arg1), __memo_parameter_arg2 = __memo_scope.param(2, arg2); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/param-calls.ets b/ui2abc/memo-plugin/test/golden/HQ/param-calls.ets index 89c435a3b0b55ae33592ebe91a483fb8d5c3e00c..d4ac74aaae90642e781c6c91111cf7049aba8031 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/param-calls.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/param-calls.ets @@ -13,7 +13,7 @@ class Test { return 20; }) as (()=> int))); let arg3: int = (((gensym_XXX) !== (undefined)) ? gensym_XXX : (arg1 as int)); - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_args_with_default_values_param-calls.ets"))), 5); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__param-calls.ets"))), 5); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg1 = __memo_scope.param(1, arg1), __memo_parameter_arg2 = __memo_scope.param(2, arg2), __memo_parameter_arg3 = __memo_scope.param(3, arg3), __memo_parameter_arg4 = __memo_scope.param(4, arg4); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/property-constructor.ets b/ui2abc/memo-plugin/test/golden/HQ/property-constructor.ets index 7beed3b03c6b444ed52370ced587ae3053847860..ccafcb7f76497a0ee4be1878c3c1efd51b057332 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/property-constructor.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/property-constructor.ets @@ -26,7 +26,7 @@ class AA { } @memo() public build(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_build_property-constructor.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__property-constructor.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/static-void-method.ets b/ui2abc/memo-plugin/test/golden/HQ/static-void-method.ets index 9aa9b61ee0afba3bfb16a550492daefc492dc4b8..f0491601eca131a8e19a9d21268571bf9c531b13 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/static-void-method.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/static-void-method.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public static static_method_with_type_parameter(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: T): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_static_method_with_type_parameter_static-void-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__static-void-method.ets"))), 1); const __memo_parameter_arg = __memo_scope.param(0, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_static-void-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__static-void-method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/string-compute.ets b/ui2abc/memo-plugin/test/golden/HQ/string-compute.ets index 812c5e8ba6ebc7e35b18b01bb84181f293f9e68c..6aa1d4c3f7b63d9751b2d2134b39228126243ac8 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/string-compute.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/string-compute.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public lambda_arg_with_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() arg: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type, value: string)=> string)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_lambda_arg_with_arg_string-compute.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__string-compute.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_string-compute.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__string-compute.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/string-method.ets b/ui2abc/memo-plugin/test/golden/HQ/string-method.ets index c6f7029c4e954230b4e95aaae1f240ca73ca1dff..3778c88c2d33a25f7a3aad45bee8179e50f14191 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/string-method.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/string-method.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public string_method_with_return(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: string): string { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_string_method_with_return_string-method.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__string-method.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { return __memo_scope.cached; @@ -22,7 +22,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_string-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__string-method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/type-param-method.ets b/ui2abc/memo-plugin/test/golden/HQ/type-param-method.ets index a6e013a5ab1c4611bae4b13ab5f8c836a8f8a3f6..e53ad4042e619dc8082d299eb84347b404df5400 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/type-param-method.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/type-param-method.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public method_with_type_parameter(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: T): T { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_method_with_type_parameter_type-param-method.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__type-param-method.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { return __memo_scope.cached; @@ -22,7 +22,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_type-param-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__type-param-method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/void-compute.ets b/ui2abc/memo-plugin/test/golden/HQ/void-compute.ets index 1142e1ba8da4ccfa6663d191a71b0f0e0ffe331a..e3b220873a514feff277d15e83d83961b92614ec 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/void-compute.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/void-compute.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public lambda_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() arg: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_lambda_arg_void-compute.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-compute.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_void-compute.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-compute.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/void-method-with-param.ets b/ui2abc/memo-plugin/test/golden/HQ/void-method-with-param.ets index c70f00e822b26c0346a53585b48a52acb04ce1e0..ab433db4a526501a1423befc9f39f329ff1192cd 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/void-method-with-param.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/void-method-with-param.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public void_method_with_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: string) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_with_arg_void-method-with-param.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-method-with-param.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_void-method-with-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-method-with-param.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/void-method-with-return.ets b/ui2abc/memo-plugin/test/golden/HQ/void-method-with-return.ets index 6d8bece23c70a55464d6fb5bcf6dbd31ac1ba15b..4faa378e5ede43deab2530a04cc660f43809b520 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/void-method-with-return.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/void-method-with-return.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public void_method_with_return(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: string) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_with_return_void-method-with-return.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-method-with-return.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_void-method-with-return.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-method-with-return.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/HQ/void-method.ets b/ui2abc/memo-plugin/test/golden/HQ/void-method.ets index ad93cc85955bbc7c7c2f3e7d40231a2b50ffacb0..58095d6dfafc4f471ebb6f91ac338c20fcb168c3 100644 --- a/ui2abc/memo-plugin/test/golden/HQ/void-method.ets +++ b/ui2abc/memo-plugin/test/golden/HQ/void-method.ets @@ -8,7 +8,7 @@ function main() {} class Test { @memo() public void_method(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_void-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -26,7 +26,7 @@ class Test { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_void-method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__void-method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/basic/function.ets b/ui2abc/memo-plugin/test/golden/basic/function.ets index 19d04bf261aca4bc3a905b8df0301f498268a4e5..5a8a327c8c9dc94b60dbdce8fab9e07f86a59d60 100644 --- a/ui2abc/memo-plugin/test/golden/basic/function.ets +++ b/ui2abc/memo-plugin/test/golden/basic/function.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_function.ets"))), 0); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__function.ets"))), 0); if (__memo_scope.unchanged) { __memo_scope.cached; return; diff --git a/ui2abc/memo-plugin/test/golden/basic/method.ets b/ui2abc/memo-plugin/test/golden/basic/method.ets index d16166fc90efa05437db8362da99d53c7da02767..dc6973c398c0d4871730249f7379831ed2990f75 100644 --- a/ui2abc/memo-plugin/test/golden/basic/method.ets +++ b/ui2abc/memo-plugin/test/golden/basic/method.ets @@ -8,7 +8,7 @@ function main() {} class C { @memo() public memo_method(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_method_method.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__method.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/implicit-type/main.ets b/ui2abc/memo-plugin/test/golden/implicit-type/main.ets index 55d5913cf31374990749ffb2b0b8614daf2faa72..f3337885c83415601e54aaf9792dc5fbd5a7ae5a 100644 --- a/ui2abc/memo-plugin/test/golden/implicit-type/main.ets +++ b/ui2abc/memo-plugin/test/golden/implicit-type/main.ets @@ -8,7 +8,7 @@ import { function_returning_local_type as function_returning_local_type } from " function main() {} @memo() function function_with_implicit_return_type(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_function_with_implicit_return_type_main.ets"))), 0); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__main.ets"))), 0); if (__memo_scope.unchanged) { return __memo_scope.cached; } diff --git a/ui2abc/memo-plugin/test/golden/other.ets b/ui2abc/memo-plugin/test/golden/other.ets index e7550f667265f74bfa44ba654875e5ce0c5d1271..6b934b5269c671fd07b2692f70a967cb45162c83 100644 --- a/ui2abc/memo-plugin/test/golden/other.ets +++ b/ui2abc/memo-plugin/test/golden/other.ets @@ -8,7 +8,7 @@ import { __context as __context, __id as __id, __key as __key } from "@koalaui/r function main() {} @memo() function param_capturing(__memo_context: __memo_context_type, __memo_id: __memo_id_type, s: string) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_param_capturing_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_s = __memo_scope.param(0, s); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -29,7 +29,7 @@ function main() {} } @memo() function memo_arg_call(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg1: number, arg2: ((x: number)=> number), @memo() arg3: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type, x: number)=> number), arg4?: ((x: number)=> number), @memo() arg5?: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type, x: number)=> number)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_arg_call_other.ets"))), 5); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 5); const __memo_parameter_arg1 = __memo_scope.param(0, arg1), __memo_parameter_arg2 = __memo_scope.param(1, arg2), __memo_parameter_arg3 = __memo_scope.param(2, arg3), __memo_parameter_arg4 = __memo_scope.param(3, arg4), __memo_parameter_arg5 = __memo_scope.param(4, arg5); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -48,7 +48,7 @@ function main() {} } @memo() function call_with_receiver(__memo_context: __memo_context_type, __memo_id: __memo_id_type, obj: A, @memo() v: ((this: A, __memo_context: __memo_context_type, __memo_id: __memo_id_type)=> int)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_call_with_receiver_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_obj = __memo_scope.param(0, obj), __memo_parameter_v = __memo_scope.param(1, v); if (__memo_scope.unchanged) { return __memo_scope.cached; @@ -59,7 +59,7 @@ function main() {} } @memo() function test_call_with_receiver(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_call_with_receiver_other.ets"))), 0); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 0); if (__memo_scope.unchanged) { __memo_scope.cached; return; @@ -98,7 +98,7 @@ class A { class Test { @memo() public void_method(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -111,7 +111,7 @@ class Test { } @memo() public a_method_with_implicit_return_type(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_a_method_with_implicit_return_type_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -124,7 +124,7 @@ class Test { } @memo() public void_method_with_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: string) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_with_arg_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -137,7 +137,7 @@ class Test { } @memo() public void_method_with_return(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: string) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_void_method_with_return_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -150,7 +150,7 @@ class Test { } @memo() public string_method_with_return(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: string) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_string_method_with_return_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { return __memo_scope.cached; @@ -159,7 +159,7 @@ class Test { } @memo() public method_with_type_parameter(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: T): T { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_method_with_type_parameter_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { return __memo_scope.cached; @@ -168,7 +168,7 @@ class Test { } @memo() public static static_method_with_type_parameter(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: T) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_static_method_with_type_parameter_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_arg = __memo_scope.param(0, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -181,7 +181,7 @@ class Test { } @memo() public internal_call(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_internal_call_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -195,7 +195,7 @@ class Test { } @memo() public lambda_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() arg: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_lambda_arg_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -208,7 +208,7 @@ class Test { } @memo() public lambda_arg_with_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() arg: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type, value: string)=> string)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_lambda_arg_with_arg_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -230,7 +230,7 @@ class Test { } @memo() public method_with_internals(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_method_with_internals_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -245,7 +245,7 @@ class Test { } @memo() public obj_arg(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: A) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_obj_arg_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -259,10 +259,10 @@ class Test { @memo_entry() public memoEntry(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() entry: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> R)): R { const getContext = (() => { - return __memo_context; + return __context(); }); const getId = (() => { - return __memo_id; + return __id(); }); { const __memo_context = getContext(); @@ -272,7 +272,7 @@ class Test { } @memo() public memo_content(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() content: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_content_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -300,7 +300,7 @@ class Test { } @memo() public memo_variables(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_variables_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -337,7 +337,7 @@ class Test { } @memo() public compute_test(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() arg1: (((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined), arg2: ((()=> void) | undefined), content: ((()=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_compute_test_other.ets"))), 3); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 3); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg1 = __memo_scope.param(1, arg1), __memo_parameter_arg2 = __memo_scope.param(2, arg2); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -355,7 +355,7 @@ class Test { return 20; }) as (()=> int))); let arg3: int = (((gensym_XXX) !== (undefined)) ? gensym_XXX : (arg1 as int)); - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_args_with_default_values_other.ets"))), 5); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 5); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg1 = __memo_scope.param(1, arg1), __memo_parameter_arg2 = __memo_scope.param(2, arg2), __memo_parameter_arg3 = __memo_scope.param(3, arg3), __memo_parameter_arg4 = __memo_scope.param(4, arg4); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -370,7 +370,7 @@ class Test { } @memo() public optional_args(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg1?: int, arg2?: (()=> int)) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_optional_args_other.ets"))), 3); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 3); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg1 = __memo_scope.param(1, arg1), __memo_parameter_arg2 = __memo_scope.param(2, arg2); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -387,7 +387,7 @@ class Test { } @memo() public type_alias(__memo_context: __memo_context_type, __memo_id: __memo_id_type, arg: MemoType) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_type_alias_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_arg = __memo_scope.param(1, arg); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -405,7 +405,7 @@ class Test { } @memo() public wrap_param_test(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo_wrap() obj: A): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_wrap_param_test_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_obj = __memo_scope.param(1, obj); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -460,7 +460,7 @@ declare class AbstractTest { @memo_stable() class MemoStableClass { @memo() public test1(__memo_context: __memo_context_type, __memo_id: __memo_id_type, x: string): string { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test1_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_x = __memo_scope.param(0, x); if (__memo_scope.unchanged) { return __memo_scope.cached; @@ -469,7 +469,7 @@ declare class AbstractTest { } @memo() public test2(__memo_context: __memo_context_type, __memo_id: __memo_id_type, value: int): this { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test2_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_value = __memo_scope.param(0, value); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -488,7 +488,7 @@ declare class AbstractTest { class MemoUnstableClass { @memo() public test2(__memo_context: __memo_context_type, __memo_id: __memo_id_type, value: int): this { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test2_other.ets"))), 2); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 2); const __memo_parameter_this = __memo_scope.param(0, this), __memo_parameter_value = __memo_scope.param(1, value); if (__memo_scope.unchanged) { __memo_scope.cached; @@ -508,7 +508,7 @@ class MemoUnstableClass { class Use { @memo() public test(__memo_context: __memo_context_type, __memo_id: __memo_id_type) { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_test_other.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__other.ets"))), 1); const __memo_parameter_this = __memo_scope.param(0, this); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-param.ets index 2227dbcc63ff06387dd542904b7766f6e7fee840..e335124d97f247aeef2a0fe577052d509d85cbd5 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param?: @memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-optional-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-optional-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-possibly-undefined-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-possibly-undefined-param.ets index 210be1989ad7a14bcd3b960143c3c69393ad8b2c..d4dc4cc8d55aa13470dbced49d9438d4020dfa11 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-possibly-undefined-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-optional-possibly-undefined-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param?: (@memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-optional-possibly-undefined-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-optional-possibly-undefined-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-param.ets index 73844dc72d860fe3ab721ab4e7ecf9fc8a2416f7..6595ac59e6c78223983637d66c9d31ed3cf9499f 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param: @memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-possibly-undefined-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-possibly-undefined-param.ets index 0cf90b68a46e68655a1101b62dddbfbb7662577f..999520905ef57d4b5104693327e0b06947da9d08 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-possibly-undefined-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param-and-type/memo-on-possibly-undefined-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param: (@memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-possibly-undefined-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-possibly-undefined-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-param.ets index 634cc65e1a648475bdfcc0da998fcbc1ccf4a368..4730b5dde9b511ed2b91504939ef2c8cc8702feb 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param?: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-optional-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-optional-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-possibly-undefined-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-possibly-undefined-param.ets index dcb1483baa847e7a78946d256d205284f722fc65..26ffedd6af01f4bce7c1322f204765c8248cec24 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-possibly-undefined-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-optional-possibly-undefined-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param?: (((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-optional-possibly-undefined-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-optional-possibly-undefined-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-param.ets index 1452c0a8614be20f596123802720061264c43688..39cef1ae3d1f41bae7b41d29ddabea053898787f 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param: ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-possibly-undefined-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-possibly-undefined-param.ets index 1721cd41eeb96453064c6231669e6634b47e271d..9e84dfdbbd91f07ecb9b87e838071b02ccc0dccf 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-possibly-undefined-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-param/memo-on-possibly-undefined-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo() param: (((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-possibly-undefined-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-possibly-undefined-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-param.ets index bcdfd337d20649c33195a5692982f3bd879abfc2..440b71e873eac2dbb01d622c73aa1475b8014b69 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, param?: @memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-optional-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-optional-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-possibly-undefined-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-possibly-undefined-param.ets index ae718520191b650d38746e98ddd5411340adfe6c..41ec8d5d2737e5562962bc95b13b08e199e6cc01 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-possibly-undefined-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-optional-possibly-undefined-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, param?: (@memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-optional-possibly-undefined-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-optional-possibly-undefined-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-param.ets index 4751d14724663cf944933a5595f297ea4d741a0a..a28e2c092283efc3bcdefd0ddaa2fdc571d28d37 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, param: @memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-possibly-undefined-param.ets b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-possibly-undefined-param.ets index c169a0a4ece1307e683f5dc0d11b637bcc7b2314..c8be5bc9b8b257f55a801e0e2374d578a661e036 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-possibly-undefined-param.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/on-type/memo-on-possibly-undefined-param.ets @@ -6,7 +6,7 @@ import { memo as memo } from "@koalaui/runtime/annotations"; function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, param: (@memo() ((__memo_context: __memo_context_type, __memo_id: __memo_id_type)=> void) | undefined)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_memo-on-possibly-undefined-param.ets"))), 1); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__memo-on-possibly-undefined-param.ets"))), 1); const __memo_parameter_param = __memo_scope.param(0, param); if (__memo_scope.unchanged) { __memo_scope.cached; diff --git a/ui2abc/memo-plugin/test/golden/param-usage/union-with-non-memo/primitive.ets b/ui2abc/memo-plugin/test/golden/param-usage/union-with-non-memo/primitive.ets index 40338ca918ed2c93e0a44f61d574761e8f67e134..41a72eb3b20006a01530cb0d457821153ad94aee 100644 --- a/ui2abc/memo-plugin/test/golden/param-usage/union-with-non-memo/primitive.ets +++ b/ui2abc/memo-plugin/test/golden/param-usage/union-with-non-memo/primitive.ets @@ -6,7 +6,7 @@ import { memo as memo, memo_skip as memo_skip } from "@koalaui/runtime/annotatio function main() {} @memo() function memo_function(__memo_context: __memo_context_type, __memo_id: __memo_id_type, @memo_skip() param: (Builder | string)): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_memo_function_primitive.ets"))), 0); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__primitive.ets"))), 0); if (__memo_scope.unchanged) { __memo_scope.cached; return; @@ -23,7 +23,7 @@ function main() {} } @memo() function callsite(__memo_context: __memo_context_type, __memo_id: __memo_id_type): void { - const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id_callsite_primitive.ets"))), 0); + const __memo_scope = __memo_context.scope(((__memo_id) + (__hash("id__primitive.ets"))), 0); if (__memo_scope.unchanged) { __memo_scope.cached; return;