@@ -253,24 +253,24 @@ struct BridgeJSLink {
253
253
private func renderSwiftClassWrappers( ) -> [ String ] {
254
254
var wrapperLines : [ String ] = [ ]
255
255
var modulesByName : [ String : [ ExportedClass ] ] = [ : ]
256
-
256
+
257
257
// Group classes by their module name
258
258
for skeleton in exportedSkeletons {
259
259
if skeleton. classes. isEmpty { continue }
260
-
260
+
261
261
if modulesByName [ skeleton. moduleName] == nil {
262
262
modulesByName [ skeleton. moduleName] = [ ]
263
263
}
264
264
modulesByName [ skeleton. moduleName] ? . append ( contentsOf: skeleton. classes)
265
265
}
266
-
266
+
267
267
// Generate wrapper functions for each module
268
268
for (moduleName, classes) in modulesByName {
269
269
wrapperLines. append ( " // Wrapper functions for module: \( moduleName) " )
270
270
wrapperLines. append ( " if (!importObject[ \" \( moduleName) \" ]) { " )
271
271
wrapperLines. append ( " importObject[ \" \( moduleName) \" ] = {}; " )
272
272
wrapperLines. append ( " } " )
273
-
273
+
274
274
for klass in classes {
275
275
let wrapperFunctionName = " bjs_ \( klass. name) _wrap "
276
276
wrapperLines. append ( " importObject[ \" \( moduleName) \" ][ \" \( wrapperFunctionName) \" ] = function(pointer) { " )
@@ -279,7 +279,7 @@ struct BridgeJSLink {
279
279
wrapperLines. append ( " }; " )
280
280
}
281
281
}
282
-
282
+
283
283
return wrapperLines
284
284
}
285
285
@@ -770,7 +770,9 @@ struct BridgeJSLink {
770
770
771
771
init ( moduleName: String ) {
772
772
self . moduleName = moduleName
773
- importedLines. append ( " const \( moduleName) = importObject[ \" \( moduleName) \" ] = importObject[ \" \( moduleName) \" ] || {}; " )
773
+ importedLines. append (
774
+ " const \( moduleName) = importObject[ \" \( moduleName) \" ] = importObject[ \" \( moduleName) \" ] || {}; "
775
+ )
774
776
}
775
777
776
778
func assignToImportObject( name: String , function: [ String ] ) {
0 commit comments