Changeset 134666 in webkit
- Timestamp:
- Nov 14, 2012 2:07:13 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r134665 r134666 1 2012-11-14 Mark Lam <mark.lam@apple.com> 2 3 Fixed regressions due to adding JSEventListener::m_wrapper null checks. 4 https://bugs.webkit.org/show_bug.cgi?id=102183. 5 6 Reviewed by Geoffrey Garen. 7 8 Fixed JSEventListener::operator==() to work within the contract that 9 when m_wrapper is 0, m_jsFunction is also expected to be 0. Also fixed 10 some typos in comments. 11 12 No new tests. 13 14 * bindings/js/JSEventListener.cpp: 15 (WebCore::JSEventListener::visitJSFunction): 16 (WebCore::JSEventListener::operator==): 17 * bindings/js/JSEventListener.h: 18 (WebCore::JSEventListener::jsFunction): 19 1 20 2012-11-14 Nate Chapin <japhet@chromium.org> 2 21 -
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
r134495 r134666 65 65 void JSEventListener::visitJSFunction(SlotVisitor& visitor) 66 66 { 67 // If m_wrapper is 0, then jsFunction is zombied, and should never be accessed.67 // If m_wrapper is 0, then m_jsFunction is zombied, and should never be accessed. 68 68 if (!m_wrapper) 69 69 return; … … 164 164 bool JSEventListener::operator==(const EventListener& listener) 165 165 { 166 // If m_wrapper is 0, then jsFunction is zombied, and should never be accessed. 167 if (!m_wrapper) 168 return false; 169 170 if (const JSEventListener* jsEventListener = JSEventListener::cast(&listener)) 171 return m_jsFunction == jsEventListener->m_jsFunction && m_isAttribute == jsEventListener->m_isAttribute; 166 if (const JSEventListener* jsEventListener = JSEventListener::cast(&listener)) { 167 // If m_wrapper is 0, then m_jsFunction is zombied, and should never be 168 // accessed. m_jsFunction should effectively be 0 in that case. 169 JSC::JSObject* jsFunction = m_wrapper ? m_jsFunction.get() : 0; 170 JSC::JSObject* otherJSFunction = jsEventListener->m_wrapper ? 171 jsEventListener->m_jsFunction.get() : 0; 172 return jsFunction == otherJSFunction && m_isAttribute == jsEventListener->m_isAttribute; 173 } 172 174 return false; 173 175 } -
trunk/Source/WebCore/bindings/js/JSEventListener.h
r134508 r134666 91 91 ASSERT(!m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction); 92 92 93 // If m_wrapper is 0, then jsFunction is zombied, and should never be accessed.93 // If m_wrapper is 0, then m_jsFunction is zombied, and should never be accessed. 94 94 if (!m_wrapper) 95 95 return 0;
Note: See TracChangeset
for help on using the changeset viewer.