Bug 108390

Summary: Make JSEventListener more robust in the event of the compiled handler being released.
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: New BugsAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch msaboff: review+

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.