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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.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/V8ErrorHandler.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp
index a7454d9c442f79547d144bdb5fc9eababf83550d..ea43cceac3b9be614e7dc946bb1b32e276f1fbb2 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ErrorHandler.cpp
@@ -89,9 +89,6 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptState* scriptSta
void V8ErrorHandler::storeExceptionOnErrorEventWrapper(ScriptState* scriptState, ErrorEvent* event, v8::Local<v8::Value> data, v8::Local<v8::Object> creationContext)
{
v8::Local<v8::Value> wrappedEvent = toV8(event, creationContext, scriptState->isolate());
- if (wrappedEvent.IsEmpty())
- return;
-
DCHECK(wrappedEvent->IsObject());
auto privateError = V8PrivateProperty::getErrorEventError(scriptState->isolate());
privateError.set(scriptState->context(), wrappedEvent.As<v8::Object>(), data);
@@ -100,11 +97,8 @@ void V8ErrorHandler::storeExceptionOnErrorEventWrapper(ScriptState* scriptState,
// static
v8::Local<v8::Value> V8ErrorHandler::loadExceptionFromErrorEventWrapper(ScriptState* scriptState, ErrorEvent* event, v8::Local<v8::Object> creationContext)
{
+ DCHECK(event);
v8::Local<v8::Value> wrappedEvent = toV8(event, creationContext, scriptState->isolate());
- if (wrappedEvent.IsEmpty() || !wrappedEvent->IsObject())
- return v8::Local<v8::Value>();
-
- DCHECK(wrappedEvent->IsObject());
auto privateError = V8PrivateProperty::getErrorEventError(scriptState->isolate());
v8::Local<v8::Value> error = privateError.getOrUndefined(scriptState->context(), wrappedEvent.As<v8::Object>());
if (error->IsUndefined())

Powered by Google App Engine
This is Rietveld 408576698