Skip to content

Commit

Permalink
[minor] Fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Jul 29, 2021
1 parent 6756cf5 commit bd7febb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/event-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,12 @@ const EventTarget = {
* @param {Function} listener The listener to add
* @param {Object} [options] An options object specifies characteristics about
* the event listener
* @param {Boolean} [options.once=false] A `Boolean`` indicating that the
* @param {Boolean} [options.once=false] A `Boolean` indicating that the
* listener should be invoked at most once after being added. If `true`,
* the listener would be automatically removed when invoked.
* @public
*/
addEventListener(
type,
listener,
options = { once: false, [kForOnEventAttribute]: false }
) {
addEventListener(type, listener, options = {}) {
let wrapper;

if (type === 'message') {
Expand All @@ -155,7 +151,7 @@ const EventTarget = {
return;
}

wrapper[kForOnEventAttribute] = options[kForOnEventAttribute];
wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
wrapper[kListener] = listener;

if (options.once) {
Expand Down

0 comments on commit bd7febb

Please sign in to comment.