Skip to content

Commit

Permalink
fix(engine-core): use propertyIsEnumerable from @lwc/shared
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-rk9 committed Feb 25, 2025
1 parent e7ecf15 commit feb241c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -39,15 +39,15 @@ 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];
}
}

for (const name of newDynamicOnNames) {
const oldHandler = Object.prototype.propertyIsEnumerable.call(oldDynamicOn, name)
const oldHandler = propertyIsEnumerable.call(oldDynamicOn, name)
? oldDynamicOn[name]
: null;
const newHandler = newDynamicOn[name];
Expand Down

0 comments on commit feb241c

Please sign in to comment.