File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 184184 // if we needed to load something, wait until it's loaded before resolving this
185185 Promise . all ( newPromises ) . then ( function ( ) {
186186 // add the module to end of our array
187- if ( Espruino . Config . MODULE_AS_FUNCTION )
188- loadedModuleData . push ( "Modules.addCached(" + JSON . stringify ( module . name ) + ",function(){" + module . code + "\n });") ;
187+ if ( Espruino . Config . MODULE_AS_FUNCTION ) // check for '//' is just in case, most minified modules shouldn't have it
188+ loadedModuleData . push ( "Modules.addCached(" + JSON . stringify ( module . name ) + ",function(){" + module . code . trim ( ) + ( module . code . includes ( "//" ) ? "\n" : "" ) + " });") ;
189189 else
190190 loadedModuleData . push ( "Modules.addCached(" + JSON . stringify ( module . name ) + "," + JSON . stringify ( module . code ) + ");" ) ;
191191 // We're done
You can’t perform that action at this time.
0 commit comments