Skip to content

Commit

Permalink
WebSocket properties
Browse files Browse the repository at this point in the history
  • Loading branch information
caracal-js committed Feb 27, 2022
1 parent 16aecc0 commit aedac70
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/uv.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37985,6 +37985,10 @@ class WebSocketApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
this.protocol = ctx.nativeMethods.getOwnPropertyDescriptor(this.wsProto, 'protocol');
this.send = this.wsProto.send;
this.close = this.wsProto.close;
this.CONNECTING = 0;
this.OPEN = 1;
this.CLOSING = 2;
this.CLOSED = 3;
};
overrideWebSocket() {
this.ctx.override(this.window, 'WebSocket', (target, that, args) => {
Expand All @@ -37998,6 +38002,11 @@ class WebSocketApi extends _events_js__WEBPACK_IMPORTED_MODULE_0__["default"] {
if (event.intercepted) return event.returnValue;
return new event.target(event.data.url, event.data.protocols);
}, true);

this.window.WebSocket.CONNECTING = this.CONNECTING;
this.window.WebSocket.OPEN = this.OPEN;
this.window.WebSocket.CLOSING = this.CLOSING;
this.window.WebSocket.CLOSED = this.CLOSED;
};
overrideUrl() {
this.ctx.overrideDescriptor(this.wsProto, 'url', {
Expand Down

0 comments on commit aedac70

Please sign in to comment.