Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp

Issue 2267403006: Remove redundant IsEmpty checks after calling toV8() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp b/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp
index f63529dd00cd21c51bffec490e8c6bfb6ed9bf03..809cd6a44a16eebe34cda4c7afbdb5f1bcf2fe67 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp
@@ -147,8 +147,6 @@ void V8V0CustomElementLifecycleCallbacks::created(Element* element)
v8::Isolate* isolate = m_scriptState->isolate();
v8::Local<v8::Context> context = m_scriptState->context();
v8::Local<v8::Value> receiverValue = toV8(element, context->Global(), isolate);
- if (receiverValue.IsEmpty())
- return;
v8::Local<v8::Object> receiver = receiverValue.As<v8::Object>();
// Swizzle the prototype of the wrapper.
@@ -191,13 +189,9 @@ void V8V0CustomElementLifecycleCallbacks::attributeChanged(Element* element, con
v8::Isolate* isolate = m_scriptState->isolate();
v8::Local<v8::Context> context = m_scriptState->context();
v8::Local<v8::Value> receiver = toV8(element, context->Global(), isolate);
- if (receiver.IsEmpty())
- return;
-
v8::Local<v8::Function> callback = m_attributeChanged.newLocal(isolate);
if (callback.IsEmpty())
return;
-
v8::Local<v8::Value> argv[] = {
v8String(isolate, name),
oldValue.isNull() ? v8::Local<v8::Value>(v8::Null(isolate)) : v8::Local<v8::Value>(v8String(isolate, oldValue)),
@@ -227,9 +221,6 @@ void V8V0CustomElementLifecycleCallbacks::call(const ScopedPersistent<v8::Functi
return;
v8::Local<v8::Value> receiver = toV8(element, context->Global(), isolate);
- if (receiver.IsEmpty())
- return;
-
v8::TryCatch exceptionCatcher(isolate);
exceptionCatcher.SetVerbose(true);
V8ScriptRunner::callFunction(callback, getExecutionContext(), receiver, 0, 0, isolate);

Powered by Google App Engine
This is Rietveld 408576698