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

Fix treatment of non-strings as enumerations #198

Merged
merged 1 commit into from
Apr 20, 2020
Merged

Fix treatment of non-strings as enumerations #198

merged 1 commit into from
Apr 20, 2020

Conversation

domenic
Copy link
Member

@domenic domenic commented Apr 17, 2020

Previously, we were comparing the original value with the set of possible enumeration values. This means values like { toString() { "valid-value" } } would not be allowed. Instead, we should check the post-string-conversion value.

Also changes the error messages generated in cases like these, from

The provided value has member type that 'bytes' is not a valid enumeration value for ReadableStreamType

to

The provided value has member 'type' that 'bytes' is not a valid enumeration value for ReadableStreamType

which is slightly better, although still not grammatical.

Previously, we were comparing the original value with the set of possible enumeration values. This means values like { toString() { "valid-value" } } would not be allowed. Instead, we should check the post-string-conversion value.

Also changes the error messages generated in cases like these, from

> The provided value has member type that 'bytes' is not a valid enumeration value for ReadableStreamType

to

> The provided value has member 'type' that 'bytes' is not a valid enumeration value for ReadableStreamType

which is slightly better, although still not grammatical.
@domenic domenic merged commit 6fe9bc0 into master Apr 20, 2020
@domenic domenic deleted the fix-enums branch April 20, 2020 15:09
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