Bug 195127

Summary: The parser is failing to record the token location of new in new.target.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, keith_miller, msaboff, rmorisset, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch.
ysuzuki: review+
proposed patch. ysuzuki: review+

Description Mark Lam 2019-02-27 16:08:23 PST
<rdar://problem/39645578>
Comment 1 Mark Lam 2019-02-27 16:17:59 PST
Created attachment 363152 [details]
proposed patch.
Comment 2 Yusuke Suzuki 2019-02-27 17:09:43 PST
Comment on attachment 363152 [details]
proposed patch.

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

r=me with suggestion.

> Source/JavaScriptCore/parser/Parser.cpp:4678
> +    JSTokenLocation lastNewTokenlocation;

"l" in "location" seems lower case.

> Source/JavaScriptCore/parser/Parser.cpp:4682
> +            lastNewTokenlocation = currentLocation;

Why not making this `lastNewTokenLocation = tokenLocation()` and remove `currentLocation`?
Comment 3 Mark Lam 2019-02-27 18:37:11 PST
Created attachment 363177 [details]
proposed patch.

Updated with feedback from Yusuke and Saam.  Let's try this on the EWS first.
Comment 4 Yusuke Suzuki 2019-02-27 20:58:03 PST
Comment on attachment 363177 [details]
proposed patch.

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

r=me

> Source/JavaScriptCore/parser/Parser.cpp:-4734
> -                JSTokenLocation location(tokenLocation());

If it is not difficult, can we have a test for this?
Comment 5 Mark Lam 2019-02-27 22:36:27 PST
Comment on attachment 363177 [details]
proposed patch.

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

Thanks for the review.

>> Source/JavaScriptCore/parser/Parser.cpp:-4734
>> -                JSTokenLocation location(tokenLocation());
> 
> If it is not difficult, can we have a test for this?

I'm not sure how to check for this.  So, I'll wait until we have time later to develop some infrastructure for such tests.
Comment 6 Mark Lam 2019-02-27 22:45:02 PST
Landed in r242193: <http://trac.webkit.org/r242193>.