mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
36fbbe0b86
`EventTarget` is exposed on the global scope, there is no need to use `--expose-internals` flag in the tests. Refs: https://github.com/nodejs/node/pull/35496 PR-URL: https://github.com/nodejs/node/pull/36002 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
15 lines
318 B
JavaScript
15 lines
318 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { once } = require('events');
|
|
|
|
const et = new EventTarget();
|
|
(async function() {
|
|
await once(et, 'foo');
|
|
await once(et, 'foo');
|
|
})().then(common.mustCall());
|
|
|
|
et.dispatchEvent(new Event('foo'));
|
|
setImmediate(() => {
|
|
et.dispatchEvent(new Event('foo'));
|
|
});
|