mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
6ed93b4d69
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');
|