Skip to content

Commit

Permalink
fix: Prevent shimming objects as a function even when objects start w…
Browse files Browse the repository at this point in the history
…ith on
  • Loading branch information
gvking committed Jun 24, 2024
1 parent fde4162 commit 42dcfd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion trace-anything.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ class TraceAnything {

if (options.events) {
// Shim any "on" event listener properties.
for (const k of allProperties.filter((k) => k.startsWith('on'))) {
for (const k of allProperties.filter(
(k) => (k.startsWith('on')) && object.hasOwnProperty(k))) {
TraceAnything._shimEventListenerProperty(
traced, object, k, className, options);
}
Expand Down

0 comments on commit 42dcfd3

Please sign in to comment.