Skip to content

Conversation

@jayphelps
Copy link
Contributor

@jayphelps jayphelps commented Nov 29, 2017

The current type signature says that segments is optional, but it unfortunately isn't currently. (produces segments.map errors).

This is a bit of an awkward type signature since indeed the exportName has to be optional because it being provided means it should be exported.

It's possible the ideal solution is to make segments optional, but until that time I figured this was easy enough to correct.

The README has the correct signature already. Though because JavaScript is so awesome the signature string|null|undefined might be more flexible. Your call, I can change the README.


  • Module#setMemory(initial: number, maximum: number, exportName: string | null, segments: MemorySegment[]): void

    Sets the memory. There's just one memory for now, using name "0". Providing exportName also creates a memory export.

@dcodeIO dcodeIO merged commit 85cd95e into AssemblyScript:master Nov 29, 2017
@dcodeIO
Copy link
Member

dcodeIO commented Nov 29, 2017

Yeah, might need an improvement on the binaryen side, but the fix is good, thanks!

dcodeIO added a commit to dcodeIO/binaryen that referenced this pull request Nov 29, 2017
kripken pushed a commit to WebAssembly/binaryen that referenced this pull request Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants