Bug 141272 - Parser::parseVarDeclarationList gets the wrong JSToken for the last identifier
Summary: Parser::parseVarDeclarationList gets the wrong JSToken for the last identifier
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 16:11 PST by Saam Barati
Modified: 2015-02-10 11:02 PST (History)
7 users (show)

See Also:


Attachments
patch (1.29 KB, patch)
2015-02-04 16:55 PST, Saam Barati
no flags Details | Formatted Diff | Diff
patch (6.44 KB, patch)
2015-02-10 00:33 PST, Saam Barati
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2015-02-04 16:11:15 PST
parseVarDeclarationList will turn its last identifier into a pattern if it's not already a pattern node.
But, when doing so, it will pass in the token right after the identifier, not the token corresponding to the identifier.
Comment 1 Saam Barati 2015-02-04 16:55:59 PST
Created attachment 246069 [details]
patch

will upload with changelog later tonight
Comment 2 Brent Fulgham 2015-02-05 09:55:26 PST
Do you have a test case showing this problem so we can avoid hitting it in the future?
Comment 3 Saam Barati 2015-02-06 01:16:00 PST
(In reply to comment #2)
> Do you have a test case showing this problem so we can avoid hitting it in
> the future?

Not directly for asserting the token is at a given location, but the tests I will include when I land: 
https://bugs.webkit.org/show_bug.cgi?id=141241
will fail if we break the token location. That said, this breakage is dependent on the Type Profiler's internal organization of data using text ranges. This is unlikely to change, but there is no guarantee.

Is there a more direct way to assert against the token location of given statement in a JS test?
Comment 4 Darin Adler 2015-02-07 08:16:44 PST
Comment on attachment 246069 [details]
patch

Bug fix looks good. Needs a change log and a test case.
Comment 5 Saam Barati 2015-02-10 00:33:18 PST
Created attachment 246316 [details]
patch
Comment 6 Saam Barati 2015-02-10 11:02:36 PST
landed in:
http://trac.webkit.org/changeset/179873