Bug 195127 - The parser is failing to record the token location of new in new.target.
Summary: The parser is failing to record the token location of new in new.target.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-02-27 16:08 PST by Mark Lam
Modified: 2019-02-27 22:45 PST (History)
8 users (show)

See Also:


Attachments
proposed patch. (3.64 KB, patch)
2019-02-27 16:17 PST, Mark Lam
ysuzuki: review+
Details | Formatted Diff | Diff
proposed patch. (4.31 KB, patch)
2019-02-27 18:37 PST, Mark Lam
ysuzuki: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>.