-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sentry: Improve logging for events mysteriously targeting text nodes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
- Loading branch information
Showing
3 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff --git a/esm/object.js b/esm/object.js | ||
index c63c1777dca0efb8b0e615da57dd9e8f2017ed32..bc57d870811e8af591f966a87b02f319d8bd13ac 100644 | ||
--- a/esm/object.js | ||
+++ b/esm/object.js | ||
@@ -133,6 +133,9 @@ function convertToPlainObject( | ||
/** Creates a string representation of the target of an `Event` object */ | ||
function serializeEventTarget(target) { | ||
try { | ||
+ if (target instanceof Text) { | ||
+ return htmlTreeAsString(target.parentElement) + " > ::text"; | ||
+ } | ||
return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target); | ||
} catch (_oO) { | ||
return '<unknown>'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.