Bug 60773 - Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
Summary: Web Inspector: Fix SourceJavaScriptTokenizer keyword parsing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 09:08 PDT by Alexander Pavlov (apavlov)
Modified: 2011-05-16 03:51 PDT (History)
11 users (show)

See Also:


Attachments
[PATCH] Suggested fix (4.89 KB, patch)
2011-05-13 09:40 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[PATCH] Test added (6.73 KB, patch)
2011-05-16 02:39 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff

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