diff --git a/Plugins/BridgeJS/Sources/BridgeJSLink/CodeFragmentPrinter.swift b/Plugins/BridgeJS/Sources/BridgeJSLink/CodeFragmentPrinter.swift index c4624e69..258a0ad1 100644 --- a/Plugins/BridgeJS/Sources/BridgeJSLink/CodeFragmentPrinter.swift +++ b/Plugins/BridgeJS/Sources/BridgeJSLink/CodeFragmentPrinter.swift @@ -12,6 +12,11 @@ final class CodeFragmentPrinter { } func write(_ line: S) { + if line.isEmpty { + // Empty lines should not have trailing spaces + lines.append("") + return + } lines.append(String(repeating: " ", count: indentLevel * 4) + String(line)) } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json index f74b3cdf..9c99bb8c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/Optionals.json @@ -1220,6 +1220,9 @@ } } } + ], + "staticMethods" : [ + ] } ] diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.js index da592066..491fc610 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ArrayTypes.js @@ -44,7 +44,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; const __bjs_createPointHelpers = () => { @@ -288,7 +288,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -298,11 +298,11 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Item_deinit, Item.prototype); } - + } const PointHelpers = __bjs_createPointHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Point = PointHelpers; - + const exports = { Item, processIntArray: function bjs_processIntArray(values) { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.js index 4015b626..d5a19543 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Async.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.js index 97827256..bc669993 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/DefaultParameters.js @@ -37,7 +37,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; const __bjs_createConfigHelpers = () => { @@ -317,7 +317,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -327,7 +327,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_DefaultGreeter_deinit, DefaultGreeter.prototype); } - + constructor(name) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -352,7 +352,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_EmptyGreeter_deinit, EmptyGreeter.prototype); } - + constructor() { const ret = instance.exports.bjs_EmptyGreeter_init(); return EmptyGreeter.__construct(ret); @@ -362,7 +362,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_ConstructorDefaults_deinit, ConstructorDefaults.prototype); } - + constructor(name = "Default", count = 42, enabled = true, status = StatusValues.Active, tag = null) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -433,10 +433,10 @@ export async function createInstantiator(options, swift) { } const ConfigHelpers = __bjs_createConfigHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Config = ConfigHelpers; - + const MathOperationsHelpers = __bjs_createMathOperationsHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.MathOperations = MathOperationsHelpers; - + const exports = { DefaultGreeter, EmptyGreeter, diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.js index 2d8dbc0c..6eb4b398 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumAssociatedValue.js @@ -506,7 +506,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -683,19 +683,19 @@ export async function createInstantiator(options, swift) { const APIResultHelpers = __bjs_createAPIResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.APIResult = APIResultHelpers; - + const ComplexResultHelpers = __bjs_createComplexResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.ComplexResult = ComplexResultHelpers; - + const ResultHelpers = __bjs_createResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.Result = ResultHelpers; - + const NetworkingResultHelpers = __bjs_createNetworkingResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.NetworkingResult = NetworkingResultHelpers; - + const APIOptionalResultHelpers = __bjs_createAPIOptionalResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.APIOptionalResult = APIOptionalResultHelpers; - + setException = (error) => { instance.exports._swift_js_exception.value = swift.memory.retain(error) } diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.js index 89a0f089..874b4c4c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumCase.js @@ -55,7 +55,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.js index f48a0050..78f08ffb 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.Global.js @@ -75,7 +75,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -286,7 +286,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -296,7 +296,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Converter_deinit, Converter.prototype); } - + constructor() { const ret = instance.exports.bjs_Converter_init(); return Converter.__construct(ret); @@ -312,7 +312,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_HTTPServer_deinit, HTTPServer.prototype); } - + constructor() { const ret = instance.exports.bjs_HTTPServer_init(); return HTTPServer.__construct(ret); @@ -325,7 +325,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_TestServer_deinit, TestServer.prototype); } - + constructor() { const ret = instance.exports.bjs_TestServer_init(); return TestServer.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.js index 1eb48336..cddeac76 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumNamespace.js @@ -56,7 +56,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -267,7 +267,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -277,7 +277,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Converter_deinit, Converter.prototype); } - + constructor() { const ret = instance.exports.bjs_Converter_init(); return Converter.__construct(ret); @@ -293,7 +293,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_HTTPServer_deinit, HTTPServer.prototype); } - + constructor() { const ret = instance.exports.bjs_HTTPServer_init(); return HTTPServer.__construct(ret); @@ -306,7 +306,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_TestServer_deinit, TestServer.prototype); } - + constructor() { const ret = instance.exports.bjs_TestServer_init(); return TestServer.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.js index 1e137e6e..315b7426 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/EnumRawType.js @@ -106,7 +106,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.js index b3b80947..b5053b26 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalGetter.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.js index 35a3d76e..0d9eb79c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/GlobalThisImports.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.js index e4ce9e8f..11aa2b3d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/ImportedTypeInExportedInterface.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; const __bjs_createFooContainerHelpers = () => { @@ -300,7 +300,7 @@ export async function createInstantiator(options, swift) { const js = swift.memory.heap; const FooContainerHelpers = __bjs_createFooContainerHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.FooContainer = FooContainerHelpers; - + const exports = { makeFoo: function bjs_makeFoo() { const ret = instance.exports.bjs_makeFoo(); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.js index ab030062..6a11003b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/InvalidPropertyNames.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClass.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClass.js index 5b7541b1..b60a698b 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClass.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClass.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClassStaticFunctions.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClassStaticFunctions.js index f8f0ba86..214a3229 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClassStaticFunctions.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/JSClassStaticFunctions.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.js index f079de1d..e1345f94 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedGlobal.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -234,7 +234,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -244,7 +244,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_GlobalClass_deinit, GlobalClass.prototype); } - + constructor() { const ret = instance.exports.bjs_GlobalClass_init(); return GlobalClass.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.js index 2c43b91e..0703be78 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedModules.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -242,7 +242,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -252,7 +252,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_GlobalClass_deinit, GlobalClass.prototype); } - + constructor() { const ret = instance.exports.bjs_GlobalClass_init(); return GlobalClass.__construct(ret); @@ -268,7 +268,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PrivateClass_deinit, PrivateClass.prototype); } - + constructor() { const ret = instance.exports.bjs_PrivateClass_init(); return PrivateClass.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.js index 4b8ce8a6..0cc377f4 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/MixedPrivate.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -234,7 +234,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -244,7 +244,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PrivateClass_deinit, PrivateClass.prototype); } - + constructor() { const ret = instance.exports.bjs_PrivateClass_init(); return PrivateClass.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.js index 671868ea..630651ae 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.Global.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -242,7 +242,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -252,7 +252,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Greeter_deinit, Greeter.prototype); } - + constructor(name) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -271,7 +271,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Converter_deinit, Converter.prototype); } - + constructor() { const ret = instance.exports.bjs_Converter_init(); return Converter.__construct(ret); @@ -287,7 +287,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_UUID_deinit, UUID.prototype); } - + uuidString() { instance.exports.bjs_UUID_uuidString(this.pointer); const ret = tmpRetString; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.js index ae7bf745..b3073da7 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Namespaces.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -242,7 +242,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -252,7 +252,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Greeter_deinit, Greeter.prototype); } - + constructor(name) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -271,7 +271,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Converter_deinit, Converter.prototype); } - + constructor() { const ret = instance.exports.bjs_Converter_init(); return Converter.__construct(ret); @@ -287,7 +287,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_UUID_deinit, UUID.prototype); } - + uuidString() { instance.exports.bjs_UUID_uuidString(this.pointer); const ret = tmpRetString; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.js index 0ec2f81c..27e9c3c6 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Optionals.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -506,7 +506,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -516,7 +516,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Greeter_deinit, Greeter.prototype); } - + constructor(name) { const isSome = name != null; let nameId, nameBytes; @@ -571,7 +571,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_OptionalPropertyHolder_deinit, OptionalPropertyHolder.prototype); } - + constructor() { const ret = instance.exports.bjs_OptionalPropertyHolder_init(); return OptionalPropertyHolder.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.js index 97e03063..98f50e85 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveParameters.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.js index 871310bb..e68e4e6a 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PrimitiveReturn.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.js index fc13a471..7bf56510 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/PropertyTypes.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -234,7 +234,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -244,7 +244,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PropertyHolder_deinit, PropertyHolder.prototype); } - + constructor(intValue, floatValue, doubleValue, boolValue, stringValue, jsObject) { const stringValueBytes = textEncoder.encode(stringValue); const stringValueId = swift.memory.retain(stringValueBytes); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.js index 24c02750..ce9065ac 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Protocol.js @@ -95,7 +95,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -579,7 +579,7 @@ export async function createInstantiator(options, swift) { const ResultHelpers = __bjs_createResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.Result = ResultHelpers; - + setException = (error) => { instance.exports._swift_js_exception.value = swift.memory.retain(error) } @@ -600,7 +600,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -610,7 +610,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Helper_deinit, Helper.prototype); } - + constructor(value) { const ret = instance.exports.bjs_Helper_init(value); return Helper.__construct(ret); @@ -630,7 +630,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_MyViewController_deinit, MyViewController.prototype); } - + constructor(delegate) { const ret = instance.exports.bjs_MyViewController_init(swift.memory.retain(delegate)); return MyViewController.__construct(ret); @@ -688,7 +688,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_DelegateManager_deinit, DelegateManager.prototype); } - + constructor(delegates) { const arrayCleanups = []; for (const elem of delegates) { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.js index e7bebfe6..b79c6ebf 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.Global.js @@ -82,7 +82,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -267,7 +267,7 @@ export async function createInstantiator(options, swift) { const APIResultHelpers = __bjs_createAPIResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.APIResult = APIResultHelpers; - + setException = (error) => { instance.exports._swift_js_exception.value = swift.memory.retain(error) } @@ -288,7 +288,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -298,7 +298,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_MathUtils_deinit, MathUtils.prototype); } - + constructor() { const ret = instance.exports.bjs_MathUtils_init(); return MathUtils.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.js index 8b5a5431..2f240c42 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticFunctions.js @@ -82,7 +82,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -267,7 +267,7 @@ export async function createInstantiator(options, swift) { const APIResultHelpers = __bjs_createAPIResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.APIResult = APIResultHelpers; - + setException = (error) => { instance.exports._swift_js_exception.value = swift.memory.retain(error) } @@ -288,7 +288,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -298,7 +298,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_MathUtils_deinit, MathUtils.prototype); } - + constructor() { const ret = instance.exports.bjs_MathUtils_init(); return MathUtils.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.js index 9806fc63..15edf8c6 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.Global.js @@ -36,7 +36,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -239,7 +239,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -249,7 +249,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PropertyClass_deinit, PropertyClass.prototype); } - + constructor() { const ret = instance.exports.bjs_PropertyClass_init(); return PropertyClass.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.js index ee127ed0..d90e96f0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StaticProperties.js @@ -36,7 +36,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -239,7 +239,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -249,7 +249,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PropertyClass_deinit, PropertyClass.prototype); } - + constructor() { const ret = instance.exports.bjs_PropertyClass_init(); return PropertyClass.__construct(ret); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.js index 03a4bc9b..fc67c002 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringParameter.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.js index 98ea9fa4..50edf3b0 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/StringReturn.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.js index d04cd650..f3d5cafc 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClass.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -242,7 +242,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -252,7 +252,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Greeter_deinit, Greeter.prototype); } - + constructor(name) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -289,13 +289,13 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PublicGreeter_deinit, PublicGreeter.prototype); } - + } class PackageGreeter extends SwiftHeapObject { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_PackageGreeter_deinit, PackageGreeter.prototype); } - + } const exports = { Greeter, diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.js index 40378d04..59512a7e 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosure.js @@ -133,7 +133,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -303,7 +303,7 @@ export async function createInstantiator(options, swift) { tmpRetOptionalHeapObject = undefined; return pointer || 0; } - + bjs["invoke_js_callback_TestModule_10TestModule10HttpStatusO_Si"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -315,7 +315,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule10HttpStatusO_Si"] = function(closurePtr) { return function(param0) { try { @@ -326,7 +326,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModule5ThemeO_SS"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -345,7 +345,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule5ThemeO_SS"] = function(closurePtr) { return function(param0) { try { @@ -361,7 +361,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModule5ThemeO_Sb"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -375,7 +375,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule5ThemeO_Sb"] = function(closurePtr) { return function(param0) { try { @@ -388,7 +388,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModule6PersonC_SS"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -405,7 +405,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule6PersonC_SS"] = function(closurePtr) { return function(param0) { try { @@ -419,7 +419,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModule9APIResultO_SS"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -436,7 +436,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule9APIResultO_SS"] = function(closurePtr) { return function(param0) { try { @@ -451,7 +451,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModule9DirectionO_SS"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -468,7 +468,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule9DirectionO_SS"] = function(closurePtr) { return function(param0) { try { @@ -482,7 +482,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModule9DirectionO_Sb"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -494,7 +494,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModule9DirectionO_Sb"] = function(closurePtr) { return function(param0) { try { @@ -505,7 +505,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModuleSS_SS"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -524,7 +524,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSS_SS"] = function(closurePtr) { return function(param0) { try { @@ -540,7 +540,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModuleSq5ThemeO_SS"] = function(callbackId, param0IsSome, param0Value) { try { const callback = swift.memory.getObject(callbackId); @@ -564,7 +564,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSq5ThemeO_SS"] = function(closurePtr) { return function(param0) { try { @@ -584,7 +584,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS"] = function(callbackId, param0IsSome, param0Value, param1IsSome, param1Value, param2IsSome, param2Value) { try { const callback = swift.memory.getObject(callbackId); @@ -620,7 +620,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSq6PersonCSqSSSqSd_SS"] = function(closurePtr) { return function(param0, param1, param2) { try { @@ -642,7 +642,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModuleSq6PersonC_SS"] = function(callbackId, param0IsSome, param0Value) { try { const callback = swift.memory.getObject(callbackId); @@ -664,7 +664,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSq6PersonC_SS"] = function(closurePtr) { return function(param0) { try { @@ -679,7 +679,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModuleSq9APIResultO_SS"] = function(callbackId, param0IsSome, param0Value) { try { const callback = swift.memory.getObject(callbackId); @@ -701,7 +701,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSq9APIResultO_SS"] = function(closurePtr) { return function(param0) { try { @@ -722,7 +722,7 @@ export async function createInstantiator(options, swift) { } }; }; - + bjs["invoke_js_callback_TestModule_10TestModuleSq9DirectionO_SS"] = function(callbackId, param0IsSome, param0Value) { try { const callback = swift.memory.getObject(callbackId); @@ -744,7 +744,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSq9DirectionO_SS"] = function(closurePtr) { return function(param0) { try { @@ -778,7 +778,7 @@ export async function createInstantiator(options, swift) { const APIResultHelpers = __bjs_createAPIResultValuesHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, textEncoder, swift); enumHelpers.APIResult = APIResultHelpers; - + setException = (error) => { instance.exports._swift_js_exception.value = swift.memory.retain(error) } @@ -799,7 +799,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -809,7 +809,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Person_deinit, Person.prototype); } - + constructor(name) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -822,7 +822,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_TestProcessor_deinit, TestProcessor.prototype); } - + constructor(transform) { const callbackId = swift.memory.retain(transform); const ret = instance.exports.bjs_TestProcessor_init(callbackId); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.js index 9ab218df..145eeb75 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftClosureImports.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; @@ -202,7 +202,7 @@ export async function createInstantiator(options, swift) { tmpRetOptionalHeapObject = undefined; return pointer || 0; } - + bjs["invoke_js_callback_TestModule_10TestModuleSi_Si"] = function(callbackId, param0Id) { try { const callback = swift.memory.getObject(callbackId); @@ -214,7 +214,7 @@ export async function createInstantiator(options, swift) { return 0; } }; - + bjs["lower_closure_TestModule_10TestModuleSi_Si"] = function(closurePtr) { return function(param0) { try { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.js index dbeb70e6..f389900d 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStruct.js @@ -36,7 +36,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; const __bjs_createDataPointHelpers = () => { @@ -569,7 +569,7 @@ export async function createInstantiator(options, swift) { obj.registry.register(this, obj.pointer); return obj; } - + release() { this.registry.unregister(this); this.deinit(this.pointer); @@ -579,7 +579,7 @@ export async function createInstantiator(options, swift) { static __construct(ptr) { return SwiftHeapObject.__wrap(ptr, instance.exports.bjs_Greeter_deinit, Greeter.prototype); } - + constructor(name) { const nameBytes = textEncoder.encode(name); const nameId = swift.memory.retain(nameBytes); @@ -608,25 +608,25 @@ export async function createInstantiator(options, swift) { } const DataPointHelpers = __bjs_createDataPointHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.DataPoint = DataPointHelpers; - + const AddressHelpers = __bjs_createAddressHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Address = AddressHelpers; - + const PersonHelpers = __bjs_createPersonHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Person = PersonHelpers; - + const SessionHelpers = __bjs_createSessionHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Session = SessionHelpers; - + const MeasurementHelpers = __bjs_createMeasurementHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Measurement = MeasurementHelpers; - + const ConfigStructHelpers = __bjs_createConfigStructHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.ConfigStruct = ConfigStructHelpers; - + const ContainerHelpers = __bjs_createContainerHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Container = ContainerHelpers; - + const exports = { Greeter, roundtrip: function bjs_roundtrip(session) { diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.js index f4e7e61e..afed321c 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/SwiftStructImports.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; const __bjs_createPointHelpers = () => { @@ -252,7 +252,7 @@ export async function createInstantiator(options, swift) { const js = swift.memory.heap; const PointHelpers = __bjs_createPointHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.Point = PointHelpers; - + const exports = { }; _exports = exports; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.js index 5a492295..8a1c4964 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/Throws.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.js index 2ac28b7e..61f6c6cf 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/UnsafePointer.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null; const __bjs_createPointerFieldsHelpers = () => { @@ -246,7 +246,7 @@ export async function createInstantiator(options, swift) { const js = swift.memory.heap; const PointerFieldsHelpers = __bjs_createPointerFieldsHelpers()(tmpParamInts, tmpParamF32s, tmpParamF64s, tmpParamPointers, tmpRetPointers, textEncoder, swift, enumHelpers); structHelpers.PointerFields = PointerFieldsHelpers; - + const exports = { takeUnsafeRawPointer: function bjs_takeUnsafeRawPointer(p) { instance.exports.bjs_takeUnsafeRawPointer(p); diff --git a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.js b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.js index f37cbd90..053c5567 100644 --- a/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.js +++ b/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/VoidParameterVoidReturn.js @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) { let tmpStructCleanups = []; const enumHelpers = {}; const structHelpers = {}; - + let _exports = null; let bjs = null;