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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ToV8.h

Issue 1936433002: Use [[DefineOwnProperty]] when converting IDL array values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ToV8.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
index 3f4a97795b59ea2d00ceff072b9e83cefde0a52c..497deccc3af590703b7293ec67b9c0835d1cfb38 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
@@ -209,7 +209,7 @@ inline v8::Local<v8::Value> toV8SequenceInternal(const Sequence& sequence, v8::L
v8::Local<v8::Value> value = toV8(*iter, array, isolate);
if (value.IsEmpty())
value = v8::Undefined(isolate);
- if (!v8CallBoolean(array->Set(isolate->GetCurrentContext(), v8::Integer::New(isolate, index++), value)))
+ if (!v8CallBoolean(array->CreateDataProperty(isolate->GetCurrentContext(), index++, value)))
return v8::Local<v8::Value>();
}
return array;
@@ -239,7 +239,7 @@ inline v8::Local<v8::Value> toV8(const Vector<std::pair<String, T>>& value, v8::
v8::Local<v8::Value> v8Value = toV8(value[i].second, object, isolate);
if (v8Value.IsEmpty())
v8Value = v8::Undefined(isolate);
- if (!v8CallBoolean(object->Set(isolate->GetCurrentContext(), v8String(isolate, value[i].first), v8Value)))
+ if (!v8CallBoolean(object->CreateDataProperty(isolate->GetCurrentContext(), v8String(isolate, value[i].first), v8Value)))
return v8::Local<v8::Value>();
}
return object;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/js/webidl-sequence-conversion.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698