Skip to content

Commit

Permalink
Add rationale comments for write
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Aug 18, 2022
1 parent 7532e6a commit 745f3c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Runtime/src/js-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export const decodeArray = (ptr: pointer, length: number, memory: Memory) => {
return result;
};

// A helper function to encode a RawJSValue into a pointers.
// Please prefer to use `writeAndReturnKindBits` to avoid unnecessary
// memory stores.
// This function should be used only when kind flag is stored in memory.
export const write = (
value: any,
kind_ptr: pointer,
Expand Down

0 comments on commit 745f3c6

Please sign in to comment.