Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add a switch fallthrough to reduce duplicated code
  • Loading branch information
j-f1 committed Aug 2, 2020
commit 34c6d86d2a077ef99880f897cc6e6b3cef1bcddd
6 changes: 2 additions & 4 deletions Runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ export class SwiftRuntime {
dataView.getUint32(payload2_ptr, true)
);
}
case JavaScriptValueKind.Object: {
case JavaScriptValueKind.Object:
case JavaScriptValueKind.Function: {
return this.heap.referenceHeap(dataView.getUint32(payload1_ptr, true))
}
case JavaScriptValueKind.Null: {
Expand All @@ -189,9 +190,6 @@ export class SwiftRuntime {
case JavaScriptValueKind.Undefined: {
return undefined
}
case JavaScriptValueKind.Function: {
return this.heap.referenceHeap(dataView.getUint32(payload1_ptr, true))
}
default:
throw new Error(`Type kind "${kind}" is not supported`)
}
Expand Down