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

Unified Diff: Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp

Issue 9186030: Merge 104736 - [v8] Int16Array.set(array, offset) fails on first execution (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp
===================================================================
--- Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp (revision 104771)
+++ Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp (working copy)
@@ -58,12 +58,18 @@
}
-void copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcArray)
+void copyElements(v8::Handle<v8::Object> destArray, v8::Handle<v8::Object> srcArray, uint32_t offset)
{
v8::Handle<v8::String> key = v8::String::New("set");
v8::Handle<v8::Function> set = destArray->Get(key).As<v8::Function>();
- v8::Handle<v8::Value> argument = srcArray;
- set->Call(destArray, 1, &argument);
+ v8::Handle<v8::Value> arguments[2];
+ int numberOfArguments = 1;
+ arguments[0] = srcArray;
+ if (offset) {
+ arguments[1] = v8::Uint32::New(offset);
+ numberOfArguments = 2;
+ }
+ set->Call(destArray, numberOfArguments, arguments);
}
}
« no previous file with comments | « Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698