-
Notifications
You must be signed in to change notification settings - Fork 14
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
[js-api] Specify changes to Module, Memory, Table and Global. #17
Conversation
@rossberg wondering if we can merge this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I had missed that this was ready for review again.
Looks good, just a few questions/nits regarding factorisation of type definitions.
document/js-api/index.bs
Outdated
@@ -596,16 +645,24 @@ interface Instance { | |||
<h3 id="memories">Memories</h3> | |||
|
|||
<pre class="idl"> | |||
dictionary MemoryDescriptor { | |||
required [EnforceRange] unsigned long initial; | |||
dictionary InitialMemoryDescriptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not express this as derived from MemoryType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recall, I can change if you'd like me to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, this is best seen as a minor variation of the "main" type.
document/js-api/index.bs
Outdated
@@ -706,19 +782,28 @@ enum TableKind { | |||
// e.g., typed function references, typed GC references | |||
}; | |||
|
|||
dictionary TableDescriptor { | |||
dictionary InitialTableDescriptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annoyingly, I had to comment out the constructor with this change due to plinss/widlparser#62.
required ExternKind kind; | ||
AnyExternType type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal factors these fields out into a superclass ExternType
that is common to both ModuleImport- and ModuleExportDescriptor. Probably makes no observable difference at the moment, but the notion of ExternType is meaningful separately from import/export names, to describe the type of an extern object themselves, and may come in handy in future extensions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be inclined to wait with this change until it's needed, but don't feel strongly. Let me know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd vote for doing it now, since it makes the relationship between the types clearer and avoids rethinking it in the future.
@rossberg ping |
@rossberg I don't have push access here; could you push the button? Thanks! |
No description provided.