Skip to content

Commit 5a3ecf2

Browse files
npm run format
1 parent 2b86b41 commit 5a3ecf2

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Runtime/src/index.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,7 @@ export class SwiftRuntime {
8888
for (let index = 0; index < args.length; index++) {
8989
const argument = args[index];
9090
const base = argv + 16 * index;
91-
JSValue.write(
92-
argument,
93-
base,
94-
base + 4,
95-
base + 8,
96-
false,
97-
memory
98-
);
91+
JSValue.write(argument, base, base + 4, base + 8, false, memory);
9992
}
10093
let output: any;
10194
// This ref is released by the swjs_call_host_function implementation
@@ -301,8 +294,8 @@ export class SwiftRuntime {
301294
const obj = memory.getObject(obj_ref);
302295
const func = memory.getObject(func_ref);
303296
let result = undefined;
304-
const args = JSValue.decodeArray(argv, argc, memory);
305-
result = func.apply(obj, args);
297+
const args = JSValue.decodeArray(argv, argc, memory);
298+
result = func.apply(obj, args);
306299
return JSValue.writeV2(
307300
result,
308301
payload1_ptr,

Runtime/src/js-value.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export const decode = (
5252
// `decodeValues` assumes that the size of RawJSValue is 16.
5353
export const decodeArray = (ptr: pointer, length: number, memory: Memory) => {
5454
// fast path for empty array
55-
if (length === 0) { return []; }
55+
if (length === 0) {
56+
return [];
57+
}
5658

5759
let result = [];
5860
// It's safe to hold DataView here because WebAssembly.Memory.buffer won't
@@ -128,7 +130,6 @@ export const write = (
128130
}
129131
};
130132

131-
132133
export const writeV2 = (
133134
value: any,
134135
payload1_ptr: pointer,
@@ -143,7 +144,7 @@ export const writeV2 = (
143144

144145
const writeRef = (kind: Kind) => {
145146
memory.writeUint32(payload1_ptr, memory.retain(value));
146-
return exceptionBit | kind
147+
return exceptionBit | kind;
147148
};
148149

149150
const type = typeof value;

0 commit comments

Comments
 (0)