Skip to content

Commit bd7febb

Browse files
committed
[minor] Fix nits
1 parent 6756cf5 commit bd7febb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/event-target.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,12 @@ const EventTarget = {
122122
* @param {Function} listener The listener to add
123123
* @param {Object} [options] An options object specifies characteristics about
124124
* the event listener
125-
* @param {Boolean} [options.once=false] A `Boolean`` indicating that the
125+
* @param {Boolean} [options.once=false] A `Boolean` indicating that the
126126
* listener should be invoked at most once after being added. If `true`,
127127
* the listener would be automatically removed when invoked.
128128
* @public
129129
*/
130-
addEventListener(
131-
type,
132-
listener,
133-
options = { once: false, [kForOnEventAttribute]: false }
134-
) {
130+
addEventListener(type, listener, options = {}) {
135131
let wrapper;
136132

137133
if (type === 'message') {
@@ -155,7 +151,7 @@ const EventTarget = {
155151
return;
156152
}
157153

158-
wrapper[kForOnEventAttribute] = options[kForOnEventAttribute];
154+
wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute];
159155
wrapper[kListener] = listener;
160156

161157
if (options.once) {

0 commit comments

Comments
 (0)