Skip to content

Commit

Permalink
Remove usage of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreed7 committed Jul 30, 2024
1 parent 08039af commit 7591dc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/mutation_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,21 @@
Element.prototype.addEventListener = function(eventName, listener, options) {
if (mutationEvents.has(eventName)) {
enableMutationEventPolyfill(this);
const {augmentedListener,fullEventName} = getAugmentedListener(...arguments);
const {augmentedListener,fullEventName} = getAugmentedListener(eventName, listener, options);
originalAddEventListener.apply(this, [fullEventName, augmentedListener, options]);
return;
}
originalAddEventListener.apply(this, arguments);
originalAddEventListener.call(this, eventName, listener, options);
};
const originalRemoveEventListener = window.removeEventListener;
Element.prototype.removeEventListener = function(eventName, listener, options) {
if (mutationEvents.has(eventName)) {
disableMutationEventPolyfill(this);
const {augmentedListener,fullEventName} = getAugmentedListener(...arguments);
const {augmentedListener,fullEventName} = getAugmentedListener(eventName, listener, options);
originalRemoveEventListener.apply(this, [fullEventName, augmentedListener, options]);
return;
}
originalRemoveEventListener.apply(this, arguments);
originalRemoveEventListener.call(this, eventName, listener, options);
};

// This makes things like MutationEvent.MODIFICATION not throw.
Expand Down
2 changes: 1 addition & 1 deletion src/mutation_events.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7591dc2

Please sign in to comment.