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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp

Issue 1938943002: Use v8::Object::CreateDataProperty() for object construction (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
Index: third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp
index cbfff366342a018a0e4fd0ee8d8f33d5b88ed74e..35322d3ef63b79e4ac2a61ae8e8e7abb60cd89fe 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromise.cpp
@@ -127,8 +127,10 @@ private:
return;
v8::Local<v8::Array> values = v8::Array::New(value.isolate(), m_values.size());
- for (size_t i = 0; i < m_values.size(); ++i)
- values->Set(i, m_values[i].v8Value());
+ for (size_t i = 0; i < m_values.size(); ++i) {
+ if (!v8CallBoolean(values->CreateDataProperty(value.context(), i, m_values[i].v8Value())))
+ return;
+ }
markPromiseSettled();
m_resolver.resolve(values);

Powered by Google App Engine
This is Rietveld 408576698