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

Add a frozen record type? #469

Closed
littledan opened this issue Oct 24, 2017 · 4 comments
Closed

Add a frozen record type? #469

littledan opened this issue Oct 24, 2017 · 4 comments

Comments

@littledan
Copy link
Collaborator

WebAssembly module instantiation creates an exports object which is frozen. This is not a frozenarray, it's more like a frozen record, since the keys are arbitrary strings. It seems like if I declare the WebIDL type to be a record, I can't just call SetIntegrityLevel(array, "frozen") in my own spec, since I don't have access to the object after it is converted by WebIDL. Would it make sense to define a new type here?

@domenic
Copy link
Member

domenic commented Oct 24, 2017

This is a return type, right? In that case I'd just use object personally. Others don't always agree with me, but I find worrying about Web IDL return types a bit silly, since they don't have JS-observable impacts (like how argument types cause coercion algorithms to run).

@bzbarsky
Copy link
Collaborator

For now, I agree: use object and manual definition of things on it. If we end up with multiple consumers that want this, we can think about specifying something.

@littledan
Copy link
Collaborator Author

OK, sounds good, thanks!

@annevk
Copy link
Member

annevk commented Oct 25, 2017

@domenic one thing that we rely on in places is that returning a byte sequence to something that returns a ByteString in IDL does the right thing. There's also things like that for things that return a sequence (which turns whatever into an Array). Return values definitely have some impact, if only converting from IDL to JavaScript, but as I've shown also more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants