Bug 60773

Summary: Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, commit-queue, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Suggested fix
none
[PATCH] Test added none

Description Alexander Pavlov (apavlov) 2011-05-13 09:08:11 PDT
SourceJavaScriptTokenizer has two issues with keyword parsing:
1. Keywords are tested as "token in this._keywords", thus "__proto__" and all methods found on a generic objects (e.g. "toString" are considered to be keywords)
2. "true}" is parsed as a single "javascript-ident", since the
yych = "}"; if (yych <= 0x7F)...
check always fails (JavaScript does not define comparisons of strings vs. integers the way we need).
Comment 1 Alexander Pavlov (apavlov) 2011-05-13 09:40:50 PDT
Created attachment 93467 [details]
[PATCH] Suggested fix
Comment 2 Pavel Feldman 2011-05-13 11:23:55 PDT
Comment on attachment 93467 [details]
[PATCH] Suggested fix

Could you a test for these cases into the existing tokenizer tests? Otherwise looks good.
Comment 3 Alexander Pavlov (apavlov) 2011-05-16 02:39:08 PDT
Created attachment 93628 [details]
[PATCH] Test added
Comment 4 WebKit Commit Bot 2011-05-16 03:51:21 PDT
Comment on attachment 93628 [details]
[PATCH] Test added

Clearing flags on attachment: 93628

Committed r86554: <http://trac.webkit.org/changeset/86554>
Comment 5 WebKit Commit Bot 2011-05-16 03:51:26 PDT
All reviewed patches have been landed.  Closing bug.