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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ToV8.h

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/ToV8.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
index 0b35902f74b0966d9beceadbb7b9854ed413f81d..de2c743fda5c42689c0ea60449277621bf83ef8d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
@@ -217,8 +217,6 @@ inline v8::Local<v8::Value> toV8SequenceInternal(const Sequence& sequence, v8::L
typename Sequence::const_iterator end = sequence.end();
for (typename Sequence::const_iterator iter = sequence.begin(); iter != end; ++iter) {
v8::Local<v8::Value> value = toV8(*iter, array, isolate);
- if (value.IsEmpty())
- value = v8::Undefined(isolate);
if (!v8CallBoolean(array->CreateDataProperty(isolate->GetCurrentContext(), index++, value)))
return v8::Local<v8::Value>();
}
@@ -247,8 +245,6 @@ inline v8::Local<v8::Value> toV8(const Vector<std::pair<String, T>>& value, v8::
}
for (unsigned i = 0; i < value.size(); ++i) {
v8::Local<v8::Value> v8Value = toV8(value[i].second, object, isolate);
- if (v8Value.IsEmpty())
- v8Value = v8::Undefined(isolate);
if (!v8CallBoolean(object->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, value[i].first), v8Value)))
return v8::Local<v8::Value>();
}

Powered by Google App Engine
This is Rietveld 408576698