| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 95cbfce commit 0c32920
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -240,7 +240,7 @@ class EventTarget { | |||
| 240 | 240 | } | |
| 241 | 241 | ||
| 242 | 242 | let handler = root.next; | |
| 243 | - let previous; | ||
| 243 | + let previous = root; | ||
| 244 | 244 | ||
| 245 | 245 | // We have to walk the linked list to see if we have a match | |
| 246 | 246 | while (handler !== undefined && !handler.same(listener, capture)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,19 @@ | |||
| 1 | + // Flags: --expose-internals --no-warnings | ||
| 2 | + 'use strict'; | ||
| 3 | + const common = require('../common'); | ||
| 4 | + const { | ||
| 5 | + Event, | ||
| 6 | + EventTarget, | ||
| 7 | + } = require('internal/event_target'); | ||
| 8 | + const { once } = require('events'); | ||
| 9 | + | ||
| 10 | + const et = new EventTarget(); | ||
| 11 | + (async function() { | ||
| 12 | + await once(et, 'foo'); | ||
| 13 | + await once(et, 'foo'); | ||
| 14 | + })().then(common.mustCall()); | ||
| 15 | + | ||
| 16 | + et.dispatchEvent(new Event('foo')); | ||
| 17 | + setImmediate(() => { | ||
| 18 | + et.dispatchEvent(new Event('foo')); | ||
| 19 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments