1
0
Эх сурвалжийг харах

Settle on customTSWorkerFactory

Orta 4 жил өмнө
parent
commit
471de29a20

+ 3 - 3
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)
 		}
 	}
 

+ 1 - 1
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