Settle on customTSWorkerFactory

This commit is contained in:
Orta 2020-08-21 10:33:52 -04:00
parent c402ee962f
commit 471de29a20
2 changed files with 4 additions and 4 deletions

View file

@ -252,11 +252,11 @@ export function create(ctx: IWorkerContext, createData: ICreateData): TypeScript
// @ts-ignore - This is available in a webworker // @ts-ignore - This is available in a webworker
importScripts(createData.customWorkerPath) importScripts(createData.customWorkerPath)
// @ts-ignore - This should come from the above eval // @ts-ignore - This should come from the above eval
if (!self.extendTSWorkerFactory) { if (!self.customTSWorkerFactory) {
throw new Error(`The script at ${createData.customWorkerPath} does not add extendTSWorkerFactory to self`) throw new Error(`The script at ${createData.customWorkerPath} does not add customTSWorkerFactory to self`)
} }
// @ts-ignore - The throw validates this // @ts-ignore - The throw validates this
TSWorkerClass = self.extendTSWorkerFactory(TypeScriptWorker) TSWorkerClass = self.customTSWorkerFactory(TypeScriptWorker)
} }
} }

View file

@ -1,4 +1,4 @@
self.extendTSWorkerFactory = (TypeScriptWorker) => { self.customTSWorkerFactory = (TypeScriptWorker) => {
return class MonacoTSWorker extends TypeScriptWorker { return class MonacoTSWorker extends TypeScriptWorker {
// Adds a custom function to the webworker // Adds a custom function to the webworker