@@ -54,7 +54,7 @@ globalThis.languagePluginLoader = (async () => {
54
54
} else if ( self . importScripts ) { // webworker
55
55
loadScript = async ( url ) => { // This is async only for consistency
56
56
self . importScripts ( url ) ;
57
- }
57
+ } ;
58
58
} else {
59
59
throw new Error ( "Cannot determine runtime environment" ) ;
60
60
}
@@ -97,7 +97,7 @@ globalThis.languagePluginLoader = (async () => {
97
97
}
98
98
}
99
99
if ( sharedLibsOnly ) {
100
- onlySharedLibs = new Map ( ) ;
100
+ let onlySharedLibs = new Map ( ) ;
101
101
for ( let c of toLoad ) {
102
102
if ( c [ 0 ] in sharedLibraries ) {
103
103
onlySharedLibs . set ( c [ 0 ] , toLoad . get ( c [ 0 ] ) ) ;
@@ -129,7 +129,8 @@ globalThis.languagePluginLoader = (async () => {
129
129
if ( toLoad . size === 0 ) {
130
130
return Promise . resolve ( 'No new packages to load' ) ;
131
131
} else {
132
- messageCallback ( `Loading ${ [ ...toLoad . keys ( ) ] . join ( ', ' ) } ` )
132
+ let packageNames = Array . from ( toLoad . keys ( ) ) . join ( ', ' ) ;
133
+ messageCallback ( `Loading ${ packageNames } ` ) ;
133
134
}
134
135
135
136
// If running in main browser thread, try to catch errors thrown when
@@ -170,9 +171,11 @@ globalThis.languagePluginLoader = (async () => {
170
171
messageCallback ( `${ pkg } already loaded from ${ loaded } ` ) ;
171
172
continue ;
172
173
} else {
173
- errorCallback ( `URI mismatch, attempting to load package ${ pkg } from ${
174
- uri } while it is already loaded from ${
175
- loaded } . To override a dependency, load the custom package first.`) ;
174
+ errorCallback (
175
+ `URI mismatch, attempting to load package ${ pkg } from ${ uri } ` +
176
+ `while it is already loaded from ${
177
+ loaded } . To override a dependency, ` +
178
+ `load the custom package first.` ) ;
176
179
continue ;
177
180
}
178
181
}
@@ -225,8 +228,8 @@ globalThis.languagePluginLoader = (async () => {
225
228
226
229
let resolveMsg ;
227
230
if ( packageList . length > 0 ) {
228
- let package_names = packageList . join ( ', ' ) ;
229
- resolveMsg = `Loaded ${ packageList } ` ;
231
+ let packageNames = packageList . join ( ', ' ) ;
232
+ resolveMsg = `Loaded ${ packageNames } ` ;
230
233
} else {
231
234
resolveMsg = 'No packages loaded' ;
232
235
}
@@ -268,18 +271,17 @@ globalThis.languagePluginLoader = (async () => {
268
271
* messages (optional)
269
272
* @returns {Promise } Resolves to ``undefined`` when loading is complete
270
273
*/
271
- Module . loadPackage =
272
- async function ( names , messageCallback , errorCallback ) {
274
+ Module . loadPackage = async function ( names , messageCallback , errorCallback ) {
273
275
if ( ! Array . isArray ( names ) ) {
274
276
names = [ names ] ;
275
277
}
276
278
// get shared library packages and load those first
277
279
// otherwise bad things happen with linking them in firefox.
278
- sharedLibraryNames = [ ] ;
280
+ let sharedLibraryNames = [ ] ;
279
281
try {
280
- sharedLibraryPackagesToLoad =
282
+ let sharedLibraryPackagesToLoad =
281
283
recursiveDependencies ( names , messageCallback , errorCallback , true ) ;
282
- for ( pkg of sharedLibraryPackagesToLoad ) {
284
+ for ( let pkg of sharedLibraryPackagesToLoad ) {
283
285
sharedLibraryNames . push ( pkg [ 0 ] ) ;
284
286
}
285
287
} catch ( e ) {
@@ -332,7 +334,7 @@ globalThis.languagePluginLoader = (async () => {
332
334
errorCallback || console . error ) ) ;
333
335
loadPackageChain = loadPackageChain . then ( ( ) => promise . catch ( ( ) => { } ) ) ;
334
336
await promise ;
335
- }
337
+ } ;
336
338
337
339
////////////////////////////////////////////////////////////
338
340
// Fix Python recursion limit
@@ -425,7 +427,7 @@ globalThis.languagePluginLoader = (async () => {
425
427
continue ;
426
428
}
427
429
if ( typeof ( value ) === "function" ) {
428
- Module . public_api [ key ] = function ( ) { throw Error ( fatal_error_msg ) ; }
430
+ Module . public_api [ key ] = function ( ) { throw Error ( fatal_error_msg ) ; } ;
429
431
}
430
432
}
431
433
} catch ( _ ) {
@@ -658,12 +660,11 @@ globalThis.languagePluginLoader = (async () => {
658
660
let QUOTE = 3 ;
659
661
let QUOTE_ESCAPE = 4 ;
660
662
let paren_depth = 0 ;
661
- let arg_start = 0 ;
662
663
let arg_is_obj_dest = false ;
663
664
let quote_start = undefined ;
664
665
let state = START_ARG ;
665
666
// clang-format off
666
- for ( i = idx ; i < funcstr . length ; i ++ ) {
667
+ for ( let i = idx ; i < funcstr . length ; i ++ ) {
667
668
let x = funcstr [ i ] ;
668
669
if ( state === QUOTE ) {
669
670
switch ( x ) {
0 commit comments