From 471de29a2086c46149dcd5ec0eef7b3655093aca Mon Sep 17 00:00:00 2001 From: Orta Date: Fri, 21 Aug 2020 10:33:52 -0400 Subject: [PATCH] Settle on customTSWorkerFactory --- src/tsWorker.ts | 6 +++--- test/custom-worker.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tsWorker.ts b/src/tsWorker.ts index 98a0b3b9..4c9908d0 100644 --- a/src/tsWorker.ts +++ b/src/tsWorker.ts @@ -252,11 +252,11 @@ export function create(ctx: IWorkerContext, createData: ICreateData): TypeScript // @ts-ignore - This is available in a webworker importScripts(createData.customWorkerPath) // @ts-ignore - This should come from the above eval - if (!self.extendTSWorkerFactory) { - throw new Error(`The script at ${createData.customWorkerPath} does not add extendTSWorkerFactory to self`) + if (!self.customTSWorkerFactory) { + throw new Error(`The script at ${createData.customWorkerPath} does not add customTSWorkerFactory to self`) } // @ts-ignore - The throw validates this - TSWorkerClass = self.extendTSWorkerFactory(TypeScriptWorker) + TSWorkerClass = self.customTSWorkerFactory(TypeScriptWorker) } } diff --git a/test/custom-worker.js b/test/custom-worker.js index e9e7f782..498b5672 100644 --- a/test/custom-worker.js +++ b/test/custom-worker.js @@ -1,4 +1,4 @@ -self.extendTSWorkerFactory = (TypeScriptWorker) => { +self.customTSWorkerFactory = (TypeScriptWorker) => { return class MonacoTSWorker extends TypeScriptWorker { // Adds a custom function to the webworker