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

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

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 years, 6 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
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/dictionary_v8.cpp
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp
index 03ca2fa841ec425d0f818cf963c86d08f9d98922..823124424dd837482101e8ebbf17e64d6cf2d756 100644
--- a/Source/bindings/templates/dictionary_v8.cpp
+++ b/Source/bindings/templates/dictionary_v8.cpp
@@ -99,17 +99,16 @@ v8::Local<v8::Value> toV8(const {{cpp_class}}& impl, v8::Local<v8::Object> creat
bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{
- // TODO(bashi): Use ForceSet() instead of Set(). http://crbug.com/476720
{% for member in members %}
if (impl.{{member.has_method_name}}()) {
{% if member.is_object %}
ASSERT(impl.{{member.cpp_name}}().isObject());
{% endif %}
- if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}"), {{member.cpp_value_to_v8_value}})))
+ if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}"), {{member.cpp_value_to_v8_value}})))
return false;
{% if member.v8_default_value %}
} else {
- if (!v8CallBoolean(dictionary->Set(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}"), {{member.v8_default_value}})))
+ if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, "{{member.name}}"), {{member.v8_default_value}})))
return false;
{% elif member.is_required %}
} else {
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698