Bug 211147

Summary: AsyncFromSyncIterator methods should not pass absent values
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Minor CC: ews-watchlist, joepeck, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch none

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>