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

Unified Diff: Source/bindings/tests/results/core/V8TestDictionary.cpp

Issue 1051753003: bindings: Add toBoolean() to V8Binding.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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: Source/bindings/tests/results/core/V8TestDictionary.cpp
diff --git a/Source/bindings/tests/results/core/V8TestDictionary.cpp b/Source/bindings/tests/results/core/V8TestDictionary.cpp
index 0a51d655ea72787bb12dd7f5ac9badf05be9b639..22d965851e940bcf46154cbef1b016e57369b373 100644
--- a/Source/bindings/tests/results/core/V8TestDictionary.cpp
+++ b/Source/bindings/tests/results/core/V8TestDictionary.cpp
@@ -41,7 +41,9 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
if (booleanMemberValue.IsEmpty() || booleanMemberValue->IsUndefined()) {
// Do nothing.
} else {
- bool booleanMember = booleanMemberValue->BooleanValue();
+ bool booleanMember = toBoolean(isolate, booleanMemberValue, exceptionState);
+ if (exceptionState.hadException())
+ return;
impl.setBooleanMember(booleanMember);
}
@@ -53,7 +55,9 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
if (createValue.IsEmpty() || createValue->IsUndefined()) {
// Do nothing.
} else {
- bool create = createValue->BooleanValue();
+ bool create = toBoolean(isolate, createValue, exceptionState);
+ if (exceptionState.hadException())
+ return;
impl.setCreateMember(create);
}
@@ -66,7 +70,9 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value
// Do nothing.
} else {
UseCounter::countDeprecationIfNotPrivateScript(isolate, callingExecutionContext(isolate), UseCounter::CreateMember);
- bool deprecatedCreateMember = deprecatedCreateMemberValue->BooleanValue();
+ bool deprecatedCreateMember = toBoolean(isolate, deprecatedCreateMemberValue, exceptionState);
+ if (exceptionState.hadException())
+ return;
impl.setCreateMember(deprecatedCreateMember);
}

Powered by Google App Engine
This is Rietveld 408576698