mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	prevent IE script error
- even though monaco does not work in EI, scripts must not fail to load
This commit is contained in:
		| @@ -121,7 +121,7 @@ RED.editor.codeEditor.monaco = (function() { | ||||
|             const def = modulesCache[libPath]; | ||||
|             if( def ) { | ||||
|                 if(!preloadOnly) { | ||||
|                     loadedLibs.JS[libModule] = monaco.languages.typescript.javascriptDefaults.addExtraLib(def, `file://types/${libPackage}/${libModule}/index.d.ts`); | ||||
|                     loadedLibs.JS[libModule] = monaco.languages.typescript.javascriptDefaults.addExtraLib(def, "file://types/" + libPackage + "/" + libModule + "/index.d.ts"); | ||||
|                 } | ||||
|                 if(cb) { | ||||
|                     setTimeout(function() { | ||||
| @@ -134,7 +134,7 @@ RED.editor.codeEditor.monaco = (function() { | ||||
|                 .done(function(data) { | ||||
|                     modulesCache[libPath] =  data; | ||||
|                     if(!preloadOnly) { | ||||
|                         loadedLibs.JS[libModule] = monaco.languages.typescript.javascriptDefaults.addExtraLib(data, `file://types/${libPackage}/${libModule}/index.d.ts`); | ||||
|                         loadedLibs.JS[libModule] = monaco.languages.typescript.javascriptDefaults.addExtraLib(data, "file://types/" + libPackage + "/" + libModule + "/index.d.ts"); | ||||
|                     } | ||||
|                     if(cb) { cb(null, _module) } | ||||
|                 }) | ||||
| @@ -882,7 +882,8 @@ RED.editor.codeEditor.monaco = (function() { | ||||
|             if(!extraModuleLibs || extraModuleLibs.length == 0) { | ||||
|                 loadedLibs.JS[id] = monaco.languages.typescript.javascriptDefaults.addExtraLib(" ", file); | ||||
|             } else { | ||||
|                 var loadList = [...extraModuleLibs]; | ||||
|                 var loadList = []; | ||||
|                 Array.prototype.push.apply(loadList, extraModuleLibs);//Use this instead of spread operator to prevent IE syntax error | ||||
|                 var loadExtraModules = {}; | ||||
|                 for (let index = 0; index < extraModuleLibs.length; index++) { | ||||
|                     const lib = extraModuleLibs[index]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user