-
Notifications
You must be signed in to change notification settings - Fork 471
[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
Conversation
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.
document/js-api/index.bs
Outdated
@@ -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: |
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.
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.
document/js-api/index.bs
Outdated
@@ -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)] |
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.
Web IDL currently does not support undefined
. How about just removing = undefined
?
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.
Done.
See discussion in issue #816. In the future, we'll want to store
non-numeric values in a
WebAssembly.Global
object, so usingunrestricted double
is over-constrained.