Bug 184630

Summary: Function.prototype.caller shouldn't return generator bodies
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220216
Attachments:
Description Flags
the patch
ysuzuki: review+
patch for landing
ews-watchlist: commit-queue-
patch for landing none

Description Filip Pizlo 2018-04-14 13:07:39 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2018-04-14 13:08:54 PDT
Created attachment 337961 [details]
the patch
Comment 2 Yusuke Suzuki 2018-04-14 13:12:03 PDT
Comment on attachment 337961 [details]
the patch

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

r=me, nice.

> JSTests/stress/function-caller-generator-body.js:24
> +})();

Can you add a test for,

1. Async functions, which uses generators internally
2. generator method functions like

class A {
    *gen() {
        ...
    }
}

var a = new A();
var gen = a.gen();
Comment 3 Filip Pizlo 2018-04-14 13:12:43 PDT
(In reply to Yusuke Suzuki from comment #2)
> Comment on attachment 337961 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=337961&action=review
> 
> r=me, nice.
> 
> > JSTests/stress/function-caller-generator-body.js:24
> > +})();
> 
> Can you add a test for,
> 
> 1. Async functions, which uses generators internally
> 2. generator method functions like
> 
> class A {
>     *gen() {
>         ...
>     }
> }
> 
> var a = new A();
> var gen = a.gen();

Good idea, will do.
Comment 4 Filip Pizlo 2018-04-14 13:23:25 PDT
Created attachment 337962 [details]
patch for landing
Comment 5 EWS Watchlist 2018-04-14 14:38:39 PDT
Comment on attachment 337962 [details]
patch for landing

Attachment 337962 [details] did not pass jsc-ews (mac):
Output: http://webkit-queues.webkit.org/results/7317590

New failing tests:
stress/function-caller-async-function-body.js.default
Comment 6 Filip Pizlo 2018-04-15 09:12:43 PDT
Created attachment 337972 [details]
patch for landing
Comment 7 Filip Pizlo 2018-04-15 10:38:20 PDT
Landed in https://trac.webkit.org/changeset/230662/webkit
Comment 8 Radar WebKit Bug Importer 2018-04-15 10:39:18 PDT
<rdar://problem/39443234>