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

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 b66fc3163d1c8f05051b0fb52f71768ca3287746..6c94a96bcd97898f2239169361ca6f2e2901ab8a 100644
--- a/Source/bindings/tests/results/core/V8TestDictionary.cpp
+++ b/Source/bindings/tests/results/core/V8TestDictionary.cpp
@@ -45,7 +45,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);
}
@@ -57,7 +59,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);
}
@@ -70,7 +74,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);
}
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698