Bug 25418 - Remove new lines from the listener function wrappers
Summary: Remove new lines from the listener function wrappers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-27 04:14 PDT by Yury Semikhatsky
Modified: 2009-05-14 09:15 PDT (History)
2 users (show)

See Also:


Attachments
Patch removing all new line characters from the handler wrapper. (1.89 KB, patch)
2009-04-27 04:18 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Remove all new lines except those going right after the original code (2.93 KB, patch)
2009-04-28 06:35 PDT, Yury Semikhatsky
dglazkov: review-
Details | Formatted Diff | Diff
Patch with Changelog entry (3.19 KB, patch)
2009-05-08 08:19 PDT, Yury Semikhatsky
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2009-04-27 04:14:10 PDT
V8LazyEventListener::getWrappedListenerFunction uses '\n' characters in the JavaScript code of the listener function wrapper. It requires additional logic when debugging pages to translate line numbers from the wrapper snippet to the original source. It seems that we can safely change the wrapper into a one-line expression and have line numbers of the wrapped handler to be the same as in the original code.
Comment 1 Yury Semikhatsky 2009-04-27 04:18:01 PDT
Created attachment 29817 [details]
Patch removing all new line characters from the handler wrapper.
Comment 2 Sam Weinig 2009-04-27 07:33:33 PDT
You should ensure that listeners specificed with a // style comment at the end still function correctly.
Comment 3 Yury Semikhatsky 2009-04-28 06:35:28 PDT
Created attachment 29843 [details]
Remove all new lines except those going right after the original code
Comment 4 Yury Semikhatsky 2009-04-28 06:37:38 PDT
Fixed. I left one '\n' after the wrapped code so that //-style comments don't break the wrapper code.
(In reply to comment #2)
> You should ensure that listeners specificed with a // style comment at the end
> still function correctly.
> 

Comment 5 Dimitri Glazkov (Google) 2009-05-08 07:54:36 PDT
Comment on attachment 29843 [details]
Remove all new lines except those going right after the original code

Code looks good, but ChangeLog entry is missing.
Comment 6 Yury Semikhatsky 2009-05-08 08:19:15 PDT
Created attachment 30130 [details]
Patch with Changelog entry
Comment 7 Yury Semikhatsky 2009-05-08 08:24:38 PDT
(In reply to comment #5)
> (From update of attachment 29843 [details] [review])
> Code looks good, but ChangeLog entry is missing.
> 

I've added ChangeLog entry.
Comment 8 Dimitri Glazkov (Google) 2009-05-14 09:00:17 PDT
Comment on attachment 30130 [details]
Patch with Changelog entry

Next time, please add a URL to the ChangeLog entry: http://webkit.org/coding/contributing.html
Comment 9 Dimitri Glazkov (Google) 2009-05-14 09:15:10 PDT
Landed as http://trac.webkit.org/changeset/43707.