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

[js-api] Specify changes to Module, Memory, Table and Global. #17

Merged
merged 2 commits into from
Nov 23, 2020

Conversation

Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Apr 27, 2020

No description provided.

@Ms2ger
Copy link
Contributor Author

Ms2ger commented Nov 12, 2020

@rossberg wondering if we can merge this

Copy link
Member

@rossberg rossberg left a 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.

@@ -596,16 +645,24 @@ interface Instance {
<h3 id="memories">Memories</h3>

<pre class="idl">
dictionary MemoryDescriptor {
required [EnforceRange] unsigned long initial;
dictionary InitialMemoryDescriptor {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@@ -706,19 +782,28 @@ enum TableKind {
// e.g., typed function references, typed GC references
};

dictionary TableDescriptor {
dictionary InitialTableDescriptor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here.

Copy link
Contributor Author

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.

Comment on lines +522 to +523
required ExternKind kind;
AnyExternType type;
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

@Ms2ger
Copy link
Contributor Author

Ms2ger commented Nov 19, 2020

@rossberg ping

@Ms2ger
Copy link
Contributor Author

Ms2ger commented Nov 20, 2020

@rossberg I don't have push access here; could you push the button? Thanks!

@rossberg rossberg merged commit b57e66e into WebAssembly:master Nov 23, 2020
@Ms2ger Ms2ger deleted the spec branch November 26, 2020 09:19
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