fix: improve event prop merging; add currentTarget #180
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #112
In some events, mergeObjects() fails to copy certain properties
When merging progress and abort events, several errors occur (probably also with error events and timeout events).
* Since there is a try-catch, xhook does not stop and no error is output.
This can be fixed by using Object.defineProperty().
currentTarget is missing in all events
As mentioned above, mergeObjects() fails to copy
currentTarget.In addition, events dispatched by xhook with empty objects do not include
currentTarget.In other words, currentTarget is missing from every event.
This can be fixed by using Object.defineProperty() for events where
currentTargetis null.* I intentionally left out
srcElementbecause it’s a deprecated alias fortarget.