Skip to content

Commit 34c6d86

Browse files
committed
Add a switch fallthrough to reduce duplicated code
1 parent 27e7b24 commit 34c6d86

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Runtime/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ export class SwiftRuntime {
180180
dataView.getUint32(payload2_ptr, true)
181181
);
182182
}
183-
case JavaScriptValueKind.Object: {
183+
case JavaScriptValueKind.Object:
184+
case JavaScriptValueKind.Function: {
184185
return this.heap.referenceHeap(dataView.getUint32(payload1_ptr, true))
185186
}
186187
case JavaScriptValueKind.Null: {
@@ -189,9 +190,6 @@ export class SwiftRuntime {
189190
case JavaScriptValueKind.Undefined: {
190191
return undefined
191192
}
192-
case JavaScriptValueKind.Function: {
193-
return this.heap.referenceHeap(dataView.getUint32(payload1_ptr, true))
194-
}
195193
default:
196194
throw new Error(`Type kind "${kind}" is not supported`)
197195
}

0 commit comments

Comments
 (0)