Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ final class CodeFragmentPrinter {
}

func write<S: StringProtocol>(_ line: S) {
if line.isEmpty {
// Empty lines should not have trailing spaces
lines.append("")
return
}
lines.append(String(repeating: " ", count: indentLevel * 4) + String(line))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,9 @@
}
}
}
],
"staticMethods" : [

]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function createInstantiator(options, swift) {
let tmpStructCleanups = [];
const enumHelpers = {};
const structHelpers = {};

let _exports = null;
let bjs = null;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Loading