-
Notifications
You must be signed in to change notification settings - Fork 465
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 tests for base64 proposal #3994
Conversation
The lint failure is silly - the new "uint8array-base64" feature presumably implies the existence of TypedArrays, so I don't think the "TypedArray" feature should need to be included. I could do so anyway if it's too much trouble to fix the linter, I guess. |
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.
Something I noticed while reviewing the spec text for this is that bypassing ECMA-402's GetOption
AO (which includes a ToString
) and doing the validation manually using is not a String
causes string objects to be rejected as option values - while I personally disagree with this choice I think it should be tested either way.
Sure, I can add tests for that, though in any real implementation I would expect that to be covered by (This behavior is very much intentional.) |
@bakkot features are often handled by an exclude list, not an include list, so a runner could exclude typed arrays and not know to exclude this one. it'd be good to add it in explicitly to the test files. |
Marked as ready for review since the proposal is now stage 3. |
…ict` lastChunkHandling Also: - add test coverage from tc39/test262#3994 - `fromBase64`: avoid invoking toString on a non-string `string` argument
…string` argument Also: - add test coverage from tc39/test262#3994
…n a non-string `string` argument Also: - add test coverage from tc39/test262#3994
… non-string `string` argument Also: - add test coverage from tc39/test262#3994
…id invoking toString on a non-string `string` argument Also: - add test coverage from tc39/test262#3994
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.
Added (or verified) all the tests in this PR to my polyfill, which exposed a few minor bugs. LGTM!
test/built-ins/Uint8Array/prototype/toBase64/detached-buffer.js
Outdated
Show resolved
Hide resolved
test/built-ins/Uint8Array/prototype/toBase64/option-coercion.js
Outdated
Show resolved
Hide resolved
I've addressed comments and hopefully pleased the linter. @ljharb I see you force-pushed to my branch but I have no idea what changes that included. I'm hoping it's just a rebase but I'm not reading a 10k line diff. I force-pushed over your changes, whatever they were. |
@bakkot oh, i just clicked the "rebase branch" button in the PR; i didn't change anything. fine to force push over. |
If you do "update with merge commit" instead of "update with rebase" it'll create a merge commit, which allows |
Merge commits are anathema, even on a PR, so that's not a good idea - |
Sorry, Anyway, the merge commits at least make it easy to tell that it's just an update of the branch, whereas that's not obvious when doing a rebase. Something to discuss elsewhere, though. |
Ideas for additional coverage:
|
Proposal repo.
It's only stage 2, so I'm marking this as a draft for now. I'm hoping to ask for stage 3 at the coming meeting, and that requires "sufficient" test262 tests (but they don't require approval by maintainers, so this review of this PR need to be rushed).Proposal is stage 3, this is ready for review/landing.