diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-03-29 04:03:49 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 13:03:49 -0400 |
commit | bced52505f32d6cca4f944bb610a8a26767908a8 (patch) | |
tree | da49a5df4b7bd6f8306248069228cd6bd0db1303 /cli/js/plugins.ts | |
parent | 1397b8e0e7c85762e19d88fde103342bfa563360 (diff) |
Update to Prettier 2 and use ES Private Fields (#4498)
Diffstat (limited to 'cli/js/plugins.ts')
-rw-r--r-- | cli/js/plugins.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cli/js/plugins.ts b/cli/js/plugins.ts index 061193b4f..3fe0574ca 100644 --- a/cli/js/plugins.ts +++ b/cli/js/plugins.ts @@ -14,17 +14,21 @@ interface PluginOp { } class PluginOpImpl implements PluginOp { - constructor(private readonly opId: number) {} + readonly #opId: number; + + constructor(opId: number) { + this.#opId = opId; + } dispatch( control: Uint8Array, zeroCopy?: ArrayBufferView | null ): Uint8Array | null { - return core.dispatch(this.opId, control, zeroCopy); + return core.dispatch(this.#opId, control, zeroCopy); } setAsyncHandler(handler: AsyncHandler): void { - core.setAsyncHandler(this.opId, handler); + core.setAsyncHandler(this.#opId, handler); } } @@ -37,16 +41,16 @@ interface Plugin { } class PluginImpl implements Plugin { - private _ops: { [name: string]: PluginOp } = {}; + #ops: { [name: string]: PluginOp } = {}; - constructor(private readonly rid: number, ops: { [name: string]: number }) { + constructor(_rid: number, ops: { [name: string]: number }) { for (const op in ops) { - this._ops[op] = new PluginOpImpl(ops[op]); + this.#ops[op] = new PluginOpImpl(ops[op]); } } get ops(): { [name: string]: PluginOp } { - return Object.assign({}, this._ops); + return Object.assign({}, this.#ops); } } |