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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/WebGLAny.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/modules/v8/WebGLAny.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/WebGLAny.cpp b/third_party/WebKit/Source/bindings/modules/v8/WebGLAny.cpp
index c6f7b1472996e2577079287481224fa359816907..1ff2ed0507a16c956f079a36ad5dd80404d3520c 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/WebGLAny.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/WebGLAny.cpp
@@ -18,7 +18,7 @@ ScriptValue WebGLAny(ScriptState* scriptState, const bool* value, size_t size)
{
v8::Local<v8::Array> array = v8::Array::New(scriptState->isolate(), size);
for (size_t i = 0; i < size; ++i) {
- if (!v8CallBoolean(array->Set(scriptState->context(), v8::Integer::New(scriptState->isolate(), i), v8Boolean(value[i], scriptState->isolate()))))
+ if (!v8CallBoolean(array->CreateDataProperty(scriptState->context(), i, v8Boolean(value[i], scriptState->isolate()))))
return ScriptValue();
}
return ScriptValue(scriptState, array);
@@ -29,7 +29,7 @@ ScriptValue WebGLAny(ScriptState* scriptState, const Vector<bool>& value)
size_t size = value.size();
v8::Local<v8::Array> array = v8::Array::New(scriptState->isolate(), size);
for (size_t i = 0; i < size; ++i) {
- if (!v8CallBoolean(array->Set(scriptState->context(), v8::Integer::New(scriptState->isolate(), i), v8Boolean(value[i], scriptState->isolate()))))
+ if (!v8CallBoolean(array->CreateDataProperty(scriptState->context(), i, v8Boolean(value[i], scriptState->isolate()))))
return ScriptValue();
}
return ScriptValue(scriptState, array);

Powered by Google App Engine
This is Rietveld 408576698