Bug 108390 - Make JSEventListener more robust in the event of the compiled handler being released.
Summary: Make JSEventListener more robust in the event of the compiled handler being r...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-30 14:57 PST by Oliver Hunt
Modified: 2013-01-30 17:30 PST (History)
0 users

See Also:


Attachments
Patch (3.21 KB, patch)
2013-01-30 15:03 PST, Oliver Hunt
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2013-01-30 14:57:52 PST
Make JSEventListener more robust in the event of the compiled handler being released.
Comment 1 Oliver Hunt 2013-01-30 15:03:29 PST
Created attachment 185591 [details]
Patch
Comment 2 Oliver Hunt 2013-01-30 17:09:52 PST
Committed r141348: <http://trac.webkit.org/changeset/141348>
Comment 3 Geoffrey Garen 2013-01-30 17:09:55 PST
Comment on attachment 185591 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185591&action=review

> Source/WebCore/bindings/js/JSLazyEventListener.cpp:-125
> -    // Since we only parse once, there's no need to keep data used for parsing around anymore.
> -    m_functionName = String();
> -    m_code = String();
> -    m_eventParameterName = String();
> -    m_sourceURL = String();

Why do we need this, given the early return?
Comment 4 Oliver Hunt 2013-01-30 17:30:19 PST
(In reply to comment #3)
> (From update of attachment 185591 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185591&action=review
> 
> > Source/WebCore/bindings/js/JSLazyEventListener.cpp:-125
> > -    // Since we only parse once, there's no need to keep data used for parsing around anymore.
> > -    m_functionName = String();
> > -    m_code = String();
> > -    m_eventParameterName = String();
> > -    m_sourceURL = String();
> 
> Why do we need this, given the early return?

So that we maintain correct behaviour - the only reason we hit this is if we want to execute the function so not running the function would result in incorrect behaviour.