Skip to content

Commit 745f3c6

Browse files
Add rationale comments for write
1 parent 7532e6a commit 745f3c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Runtime/src/js-value.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export const decodeArray = (ptr: pointer, length: number, memory: Memory) => {
7070
return result;
7171
};
7272

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

0 commit comments

Comments
 (0)