diff --git a/packages/uni-shared/src/lifecycle.ts b/packages/uni-shared/src/lifecycle.ts index 73b4c1cbc66693c1c22e6a255202dba4f46d8ad5..289c382d91bb835829cc3e8572aa009ef3e9365b 100644 --- a/packages/uni-shared/src/lifecycle.ts +++ b/packages/uni-shared/src/lifecycle.ts @@ -76,8 +76,10 @@ export const UniLifecycleHooks = [ ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ] as const -export const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = { - onPageScroll: 1, - onShareAppMessage: 1 << 1, - onShareTimeline: 1 << 2, -} as const +export const MINI_PROGRAM_PAGE_RUNTIME_HOOKS = /*#__PURE__*/ (() => { + return { + onPageScroll: 1, + onShareAppMessage: 1 << 1, + onShareTimeline: 1 << 2, + } as const +})() diff --git a/packages/uni-shared/src/vdom/encode.ts b/packages/uni-shared/src/vdom/encode.ts index 5c7d8bbd634096dcd0cd667a4383a3d3114f7650..6e465a58fbf1da3817223607c9be6d41e2141593 100644 --- a/packages/uni-shared/src/vdom/encode.ts +++ b/packages/uni-shared/src/vdom/encode.ts @@ -1,8 +1,10 @@ -export const EventOptionFlags = { - capture: 1, - once: 1 << 1, - passive: 1 << 2, -} +export const EventOptionFlags = /*#__PURE__*/ (() => { + return { + capture: 1, + once: 1 << 1, + passive: 1 << 2, + } +})() export function encodeOptions(options?: AddEventListenerOptions) { let flag = 0 @@ -20,11 +22,13 @@ export function encodeOptions(options?: AddEventListenerOptions) { return flag } -export const EventModifierFlags = { - stop: 1, - prevent: 1 << 1, - self: 1 << 2, -} +export const EventModifierFlags = /*#__PURE__*/ (() => { + return { + stop: 1, + prevent: 1 << 1, + self: 1 << 2, + } +})() export function encodeModifier(modifiers: string[]) { let flag = 0