Skip to content

Commit

Permalink
consistency: use more arrow functions to pass this context
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jan 24, 2022
1 parent e331522 commit 437e90b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/utils/PluginDriver.ts
Expand Up @@ -5,6 +5,7 @@ import type {
AddonHookFunction,
AsyncPluginHooks,
EmitFile,
EmittedFile,
FirstPluginHooks,
NormalizedInputOptions,
NormalizedOutputOptions,
Expand Down Expand Up @@ -99,11 +100,16 @@ export class PluginDriver {
options,
basePluginDriver && basePluginDriver.fileEmitter
);
this.emitFile = this.fileEmitter.emitFile.bind(this.fileEmitter);
this.getFileName = this.fileEmitter.getFileName.bind(this.fileEmitter);
this.finaliseAssets = this.fileEmitter.assertAssetsFinalized.bind(this.fileEmitter);
this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter);
this.emitFile = (emittedFile: EmittedFile) => this.fileEmitter.emitFile(emittedFile);
this.getFileName = (fileReferenceId: string) => this.fileEmitter.getFileName(fileReferenceId);
this.finaliseAssets = () => this.fileEmitter.assertAssetsFinalized();
this.setOutputBundle = (
outputBundle: OutputBundleWithPlaceholders,
outputOptions: NormalizedOutputOptions,
facadeChunkByModule: Map<Module, Chunk>
) => this.fileEmitter.setOutputBundle(outputBundle, outputOptions, facadeChunkByModule);
this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []);

const existingPluginNames = new Set<string>();

this.pluginContexts = new Map(
Expand Down

0 comments on commit 437e90b

Please sign in to comment.