|
4 | 4 | * SPDX-License-Identifier: MIT
|
5 | 5 | * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
6 | 6 | */
|
7 |
| -import { isUndefined, isNull, keys } from '@lwc/shared'; |
| 7 | +import { isUndefined, isNull, keys, propertyIsEnumerable } from '@lwc/shared'; |
8 | 8 | import { EmptyObject } from '../utils';
|
9 | 9 | import { invokeEventListener } from '../invoker';
|
10 | 10 | import type { VM } from '../vm';
|
@@ -39,15 +39,15 @@ export function patchDynamicEventListeners(
|
39 | 39 | const newDynamicOnNames = keys(newDynamicOn);
|
40 | 40 |
|
41 | 41 | for (const name of oldDynamicOnNames) {
|
42 |
| - if (!Object.prototype.propertyIsEnumerable.call(newDynamicOn, name)) { |
| 42 | + if (!propertyIsEnumerable.call(newDynamicOn, name)) { |
43 | 43 | const actualListener = actualEventListeners[name];
|
44 | 44 | removeEventListener(elm, name, actualListener);
|
45 | 45 | delete actualEventListeners[name];
|
46 | 46 | }
|
47 | 47 | }
|
48 | 48 |
|
49 | 49 | for (const name of newDynamicOnNames) {
|
50 |
| - const oldHandler = Object.prototype.propertyIsEnumerable.call(oldDynamicOn, name) |
| 50 | + const oldHandler = propertyIsEnumerable.call(oldDynamicOn, name) |
51 | 51 | ? oldDynamicOn[name]
|
52 | 52 | : null;
|
53 | 53 | const newHandler = newDynamicOn[name];
|
|
0 commit comments