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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ToV8Test.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/ToV8Test.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp b/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
index b734c23160f83eb94014e917da0d004979489627..c3cac2a093ca4a2f2870148a6a5fa6040106bd42 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
@@ -22,10 +22,6 @@ template<typename T>
void testToV8(V8TestingScope* scope, const char* expected, T value, const char* path, int lineNumber)
{
v8::Local<v8::Value> actual = toV8(value, scope->context()->Global(), scope->isolate());
- if (actual.IsEmpty()) {
- ADD_FAILURE_AT(path, lineNumber) << "toV8 returns an empty value.";
- return;
- }
String actualString = toCoreString(actual->ToString(scope->context()).ToLocalChecked());
if (String(expected) != actualString) {
ADD_FAILURE_AT(path, lineNumber) << "toV8 returns an incorrect value.\n Actual: " << actualString.utf8().data() << "\nExpected: " << expected;
@@ -234,8 +230,6 @@ TEST(ToV8Test, withScriptState)
ScriptValue value(scope.getScriptState(), v8::Number::New(scope.isolate(), 1234.0));
v8::Local<v8::Value> actual = toV8(value, scope.getScriptState());
- EXPECT_FALSE(actual.IsEmpty());
-
double actualAsNumber = actual.As<v8::Number>()->Value();
EXPECT_EQ(1234.0, actualAsNumber);
}

Powered by Google App Engine
This is Rietveld 408576698