diff --git a/packages/@lwc/engine-core/src/framework/modules/dynamic-events.ts b/packages/@lwc/engine-core/src/framework/modules/dynamic-events.ts index 4814c2da82..38fa256eec 100644 --- a/packages/@lwc/engine-core/src/framework/modules/dynamic-events.ts +++ b/packages/@lwc/engine-core/src/framework/modules/dynamic-events.ts @@ -4,7 +4,7 @@ * SPDX-License-Identifier: MIT * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT */ -import { isUndefined, isNull, keys } from '@lwc/shared'; +import { isUndefined, isNull, keys, propertyIsEnumerable } from '@lwc/shared'; import { EmptyObject } from '../utils'; import { invokeEventListener } from '../invoker'; import type { VM } from '../vm'; @@ -39,7 +39,7 @@ export function patchDynamicEventListeners( const newDynamicOnNames = keys(newDynamicOn); for (const name of oldDynamicOnNames) { - if (!Object.prototype.propertyIsEnumerable.call(newDynamicOn, name)) { + if (!propertyIsEnumerable.call(newDynamicOn, name)) { const actualListener = actualEventListeners[name]; removeEventListener(elm, name, actualListener); delete actualEventListeners[name]; @@ -47,7 +47,7 @@ export function patchDynamicEventListeners( } for (const name of newDynamicOnNames) { - if (Object.prototype.propertyIsEnumerable.call(oldDynamicOn, name)) { + if (propertyIsEnumerable.call(oldDynamicOn, name)) { const actualListener = actualEventListeners[name]; removeEventListener(elm, name, actualListener); }