Update VS Code to 1.33.0 (#445)
* Update VS Code to 1.33.0 * Fix slow file tree * Fix WindowsService fill * Provide `off` on event listeners * Fix webview * Fix double title bar and missing preferences on Mac * Bump VS Code version in Travis config * Fix black dialog text (again) * Fix shared process not starting
This commit is contained in:
@ -45,4 +45,12 @@ export class SpdlogModule {
|
||||
public setAsyncMode = (bufferSize: number, flushInterval: number): Promise<void> => {
|
||||
return this.proxy.setAsyncMode(bufferSize, flushInterval);
|
||||
}
|
||||
|
||||
public createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): RotatingLogger {
|
||||
return new RotatingLogger(this.proxy, name, filename, filesize, filecount);
|
||||
}
|
||||
|
||||
public createRotatingLoggerAsync(name: string, filename: string, filesize: number, filecount: number): Promise<RotatingLogger> {
|
||||
return Promise.resolve(this.createRotatingLogger(name, filename, filesize, filecount));
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,17 @@ export abstract class ClientProxy<T extends ServerProxy> extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an event listener.
|
||||
*/
|
||||
public off(event: string, cb: (...args: any[]) => void): this {
|
||||
// Fill it here because the fill we're using to provide EventEmitter for the
|
||||
// browser doesn't appear to include `off`.
|
||||
this.removeListener(event, cb);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
protected get proxy(): T {
|
||||
if (!this._proxy) {
|
||||
throw new Error("not initialized");
|
||||
@ -158,8 +169,10 @@ export abstract class Batch<T, A> {
|
||||
private readonly maxCount: number = 100,
|
||||
/**
|
||||
* Flush after not receiving more requests for this amount of time.
|
||||
* This is pretty low by default so essentially we just end up batching
|
||||
* requests that are all made at the same time.
|
||||
*/
|
||||
private readonly idleTime: number = 100,
|
||||
private readonly idleTime: number = 1,
|
||||
) {}
|
||||
|
||||
public add = (args: A): Promise<T> => {
|
||||
|
@ -38,6 +38,23 @@ describe("net", () => {
|
||||
expect(fn).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should remove event listener", async () => {
|
||||
const socket = new net.Socket();
|
||||
|
||||
const fn1 = jest.fn();
|
||||
const fn2 = jest.fn();
|
||||
|
||||
socket.on("error", fn1);
|
||||
socket.on("error", fn2);
|
||||
socket.off("error", fn1);
|
||||
|
||||
socket.connect("/tmp/t/e/s/t/d/o/e/s/n/o/t/e/x/i/s/t");
|
||||
|
||||
await new Promise((r): nativeNet.Socket => socket.on("close", r));
|
||||
expect(fn1).toHaveBeenCalledTimes(0);
|
||||
expect(fn2).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should connect", async () => {
|
||||
await new Promise((resolve): void => {
|
||||
const socket = net.createConnection(socketPath, () => {
|
||||
|
Reference in New Issue
Block a user