-
Notifications
You must be signed in to change notification settings - Fork 8
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
Pre-Stage-3 spec review #49
Comments
Thanks for the review!
I agree we should have an AO for reading options without coercing, though I think what we will actually do is have two versions, like
It is intentional; I haven't updated the linked PR to cover the case of not coercing objects to non-boolean primitives yet (which was decided only at the last meeting), but I will make sure to explicitly note that this applies to boxed primitives as well.
These were fixed in #39.
Ah, yeah, that's just an oversight. But the Helpers section will go away when upstreaming anyway, so I'm not going to worry about the organization for the moment. |
I suspect the |
Use of
GetOptionsObject
from ECMA-402 is good but should go one step further: also borrowGetOption
(like Temporal already does), which handles type/value checking and default values. This is unnecessarily verbose given we have an established abstraction:The main difference here is the lack of a
ToString
call, which I understand is intentional (see here). Instead of spelling these steps out repeatedly I propose thatGetOption
is altered to support different coercion behavior instead.Notably the above causes
String
objects to be rejected as option values. Of course no one will use{ alphabet: new String("base64") }
, but if provided from elsewhere this might be problematic. If intentional I'd like to see it included in how-we-work (this PR).AllocateTypedArray
is being used incorrectly twice, the default prototype must be passed as a string:ValidateUint8Array
should be used consistently,Uint8Array.fromBase64Into()
andUint8Array.fromHexInto()
currently perform the same steps manually:Arguably the AO could also be dropped, replacing two lines with one doesn't seem like a huge win.ValidateUint8Array
andGetUint8ArrayBytes
are not grouped into the Helpers section, for no apparent reason.The text was updated successfully, but these errors were encountered: