mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
This PR adds `CloseEvent` as a global, which can be disabled
via the --no-experimental-websocket flag.
```js
const ws = new WebSocket('...')
ws.addEventListener('close', (event) => {
assert(event instanceof CloseEvent)
})
```
Fixes: https://github.com/nodejs/node/issues/50275
PR-URL: https://github.com/nodejs/node/pull/53355
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
8 lines
173 B
JavaScript
8 lines
173 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.strictEqual(typeof WebSocket, 'function');
|
|
assert.strictEqual(typeof CloseEvent, 'function');
|