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

Unified Diff: third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp

Issue 1946453002: Make nullable members of IDL dictionaries contain null in JS when unset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_getComputedTiming
Patch Set: Fix test Created 4 years, 7 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/templates/dictionary_v8.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp
index 3a0d827473a4ddb1618f35a88c501649abaca71e..b59835a4777709c4d278c96070f7e748fedf68ef 100644
--- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp
+++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp
@@ -117,6 +117,10 @@ bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictiona
} else {
if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}"), {{member.v8_default_value}})))
return false;
+ {% elif member.is_nullable %}
+ } else {
+ if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}"), v8::Null(isolate))))
+ return false;
{% elif member.is_required %}
} else {
ASSERT_NOT_REACHED();

Powered by Google App Engine
This is Rietveld 408576698