mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Update to Prettier 2 and use ES Private Fields (#4498)
This commit is contained in:
parent
1397b8e0e7
commit
bced52505f
329 changed files with 2787 additions and 2430 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue