diff --git a/compiler/src/pre_define.ts b/compiler/src/pre_define.ts index a1698ab..a1cfde8 100644 --- a/compiler/src/pre_define.ts +++ b/compiler/src/pre_define.ts @@ -68,9 +68,8 @@ export const INITIALIZE_CONSUME_FUNCTION: string = 'initializeConsume'; export const ADD_PROVIDED_VAR: string = 'addProvidedVar'; export const APP_STORAGE: string = 'AppStorage'; -export const APP_STORAGE_SET_AND_PROP: string = 'setAndProp'; -export const APP_STORAGE_SET_AND_LINK: string = 'setAndLink'; -export const APP_STORAGE_GET_OR_SET: string = 'GetOrCreate'; +export const APP_STORAGE_SET_AND_PROP: string = 'SetAndProp'; +export const APP_STORAGE_SET_AND_LINK: string = 'SetAndLink'; export const PAGE_ENTRY_FUNCTION_NAME: string = 'loadDocument'; export const STORE_PREVIEW_COMPONENTS: string = 'storePreviewComponents'; diff --git a/compiler/src/process_component_constructor.ts b/compiler/src/process_component_constructor.ts index 469c6c4..5b04845 100644 --- a/compiler/src/process_component_constructor.ts +++ b/compiler/src/process_component_constructor.ts @@ -168,5 +168,5 @@ export function addConstructor(ctorNode: any, watchMap: Map, ts.factory.createThis(), ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_UPDATE_PARAMS)), undefined, [ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARAMS)])); return updateConstructor(updateConstructor(ctorNode, [], [callSuperStatement], true), [], - [updateWithValueParamsStatement, ...watchStatements], false, true, parentComponentName); + [...watchStatements, updateWithValueParamsStatement], false, true, parentComponentName); } diff --git a/compiler/src/process_component_member.ts b/compiler/src/process_component_member.ts index c432788..444a90c 100644 --- a/compiler/src/process_component_member.ts +++ b/compiler/src/process_component_member.ts @@ -44,7 +44,6 @@ import { APP_STORAGE, APP_STORAGE_SET_AND_PROP, APP_STORAGE_SET_AND_LINK, - APP_STORAGE_GET_OR_SET, COMPONENT_CONSTRUCTOR_UNDEFINED, SET_CONTROLLER_METHOD, SET_CONTROLLER_CTR, @@ -509,11 +508,9 @@ function updateStoragePropAndLinkProperty(node: ts.PropertyDeclaration, name: ts return ts.factory.createExpressionStatement(ts.factory.createBinaryExpression( createPropertyAccessExpressionWithThis(`__${name.getText()}`), ts.factory.createToken(ts.SyntaxKind.EqualsToken), ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(ts.factory.createCallExpression( - ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(APP_STORAGE), - ts.factory.createIdentifier(APP_STORAGE_GET_OR_SET)), undefined, []), - ts.factory.createIdentifier(setFuncName)), undefined, [node.decorators[0].expression.arguments[0], - node.initializer, ts.factory.createThis()]))); + ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier(APP_STORAGE), + ts.factory.createIdentifier(setFuncName)), undefined, [node.decorators[0].expression.arguments[0], + node.initializer, ts.factory.createThis(), ts.factory.createStringLiteral(name.getText())]))); } else { validateAppStorageDecoractorsNonSingleKey(node, log); }