Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support Set/Map for binding generator #2340

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
wip
  • Loading branch information
MaxGraey committed Jun 26, 2022
commit b44d2bf75c2120a6073a5909ca042f16e932b259
6 changes: 3 additions & 3 deletions src/bindings/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,12 @@ export class JSBuilder extends ExportsWalker {
if (!ptr) return null;
const
mem32 = new Uint32Array(memory.buffer),
size = mem32[ptr + ${entriesCountOffset} >>> 2],
count = mem32[ptr + ${entriesCountOffset} >>> 2],
entriesPtr = mem32[ptr + ${entriesOffset} >>> 2],
entryAlign = Math.max(1 << align, 4),
entryAlign = Math.max(1 << align, 4) - 1,
entrySize = (${entrySize} + entryAlign) & ~entryAlign,
res = new Set();
for (let i = 0; i < size; ++i) {
for (let i = 0; i < count; ++i) {
const
entryPtr = entriesPtr + i * entrySize,
tag = mem32[entryPtr + ${entryTaggedNextOffset} >>> 2];
Expand Down