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>
9 lines
213 B
JavaScript
9 lines
213 B
JavaScript
// Flags: --no-experimental-websocket
|
|
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.strictEqual(typeof WebSocket, 'undefined');
|
|
assert.strictEqual(typeof CloseEvent, 'undefined');
|