mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
refactor: remove setImmediate (#10856)
This commit is contained in:
parent
72175906a5
commit
7f9c14c745
@ -51,11 +51,9 @@ export class NodeWebSocketTransport implements ConnectionTransport {
|
|||||||
constructor(ws: NodeWebSocket) {
|
constructor(ws: NodeWebSocket) {
|
||||||
this.#ws = ws;
|
this.#ws = ws;
|
||||||
this.#ws.addEventListener('message', event => {
|
this.#ws.addEventListener('message', event => {
|
||||||
setImmediate(() => {
|
if (this.onmessage) {
|
||||||
if (this.onmessage) {
|
this.onmessage.call(null, event.data);
|
||||||
this.onmessage.call(null, event.data);
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
this.#ws.addEventListener('close', () => {
|
this.#ws.addEventListener('close', () => {
|
||||||
if (this.onclose) {
|
if (this.onclose) {
|
||||||
|
Loading…
Reference in New Issue
Block a user