build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,28 +1,28 @@
|
|||
import { EventEmitter } from 'events'
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
export class MessagePortMain extends EventEmitter {
|
||||
_internalPort: any
|
||||
constructor (internalPort: any) {
|
||||
super()
|
||||
this._internalPort = internalPort
|
||||
super();
|
||||
this._internalPort = internalPort;
|
||||
this._internalPort.emit = (channel: string, event: {ports: any[]}) => {
|
||||
if (channel === 'message') { event = { ...event, ports: event.ports.map(p => new MessagePortMain(p)) } }
|
||||
this.emit(channel, event)
|
||||
}
|
||||
if (channel === 'message') { event = { ...event, ports: event.ports.map(p => new MessagePortMain(p)) }; }
|
||||
this.emit(channel, event);
|
||||
};
|
||||
}
|
||||
|
||||
start () {
|
||||
return this._internalPort.start()
|
||||
return this._internalPort.start();
|
||||
}
|
||||
|
||||
close () {
|
||||
return this._internalPort.close()
|
||||
return this._internalPort.close();
|
||||
}
|
||||
|
||||
postMessage (...args: any[]) {
|
||||
if (Array.isArray(args[1])) {
|
||||
args[1] = args[1].map((o: any) => o instanceof MessagePortMain ? o._internalPort : o)
|
||||
args[1] = args[1].map((o: any) => o instanceof MessagePortMain ? o._internalPort : o);
|
||||
}
|
||||
return this._internalPort.postMessage(...args)
|
||||
return this._internalPort.postMessage(...args);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue