Skip to content

[spec] Use any in Global constructor #818

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

Merged
merged 4 commits into from
Jun 11, 2018
Merged

[spec] Use any in Global constructor #818

merged 4 commits into from
Jun 11, 2018

Conversation

binji
Copy link
Member

@binji binji commented Jun 7, 2018

See discussion in issue #816. In the future, we'll want to store
non-numeric values in a WebAssembly.Global object, so using
unrestricted double is over-constrained.

See discussion in issue #816. In the future, we'll want to store
non-numeric values in a `WebAssembly.Global` object, so using
`unrestricted double` is over-constrained.
@binji binji requested a review from rossberg June 7, 2018 19:28
@@ -753,11 +753,19 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
1. Otherwise, throw a {{TypeError}} exception.
</div>

<div algorithm>
The algorithm <dfn>DefaultGlobalValue</dfn>(|valuetype|) performs the following steps:
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I would probably just call this DefaultValue, since it doesn't have any dependency on globals and might potentially be useful in other contexts.

@@ -720,10 +720,10 @@ dictionary GlobalDescriptor {
boolean mutable = false;
};

[LegacyNamespace=WebAssembly, Constructor(GlobalDescriptor descriptor, unrestricted double value = 0), Exposed=(Window,Worker,Worklet)]
[LegacyNamespace=WebAssembly, Constructor(GlobalDescriptor descriptor, optional any value = undefined), Exposed=(Window,Worker,Worklet)]

Choose a reason for hiding this comment

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

Web IDL currently does not support undefined. How about just removing = undefined?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@binji binji merged commit 61a547b into master Jun 11, 2018
@binji binji deleted the global-value-any branch June 11, 2018 17:14
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.

3 participants