Bug 211147 - AsyncFromSyncIterator methods should not pass absent values
Summary: AsyncFromSyncIterator methods should not pass absent values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Minor
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-28 14:39 PDT by Alexey Shvayka
Modified: 2020-04-29 14:43 PDT (History)
9 users (show)

See Also:


Attachments
Patch (4.93 KB, patch)
2020-04-28 14:51 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch (4.96 KB, patch)
2020-04-28 15:06 PDT, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2020-04-28 14:39:46 PDT
AsyncFromSyncIterator methods should not pass absent values
Comment 1 Alexey Shvayka 2020-04-28 14:51:49 PDT
Created attachment 397887 [details]
Patch
Comment 2 Alexey Shvayka 2020-04-28 15:06:25 PDT
Created attachment 397888 [details]
Patch

Use ternary + @call instead of @apply.
Comment 3 Ross Kirsling 2020-04-28 15:24:18 PDT Comment hidden (obsolete)
Comment 4 Ross Kirsling 2020-04-28 15:25:03 PDT Comment hidden (obsolete)
Comment 5 Ross Kirsling 2020-04-28 16:10:06 PDT
Comment on attachment 397888 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=397888&action=review

> Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js:42
> +        var nextResult = @argumentCount() === 0 ? nextMethod.@call(syncIterator) : nextMethod.@call(syncIterator, value);

Seems good as long as we're meant to distinguish explicit `undefined`.
Comment 6 Alexey Shvayka 2020-04-29 13:20:09 PDT
(In reply to Ross Kirsling from comment #5)

Thanks for taking a look, Ross.

> Seems good as long as we're meant to distinguish explicit `undefined`.

We are: the spec PR uses "is present" wording.
There are a few test262 cases failing if we do `=== @undefined`, but not as many as I would like.
A few more tests are coming in https://github.com/tc39/test262/pull/2604.
Comment 7 EWS 2020-04-29 14:39:45 PDT
Committed r260915: <https://trac.webkit.org/changeset/260915>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397888 [details].
Comment 8 Radar WebKit Bug Importer 2020-04-29 14:40:19 PDT
<rdar://problem/62618464>