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

Unified Diff: samples/shell.cc

Issue 6805010: Make "length" and "BYTES_PER_ELEMENT" properties of typed arrays accessible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | « no previous file | test/mjsunit/external-array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/shell.cc
diff --git a/samples/shell.cc b/samples/shell.cc
index 72aca0ff563ca865c37fc4d21c9486fecfab487d..222eeda1149406eea9206e54746fbd498a41829f 100644
--- a/samples/shell.cc
+++ b/samples/shell.cc
@@ -466,6 +466,10 @@ v8::Handle<v8::Value> CreateExternalArray(const v8::Arguments& args,
v8::Persistent<v8::Object>::New(array);
persistent_array.MakeWeak(data, ExternalArrayWeakCallback);
array->SetIndexedPropertiesToExternalArrayData(data, type, length);
+ array->Set(v8::String::New("length"), v8::Int32::New(length),
+ v8::ReadOnly);
+ array->Set(v8::String::New("BYTES_PER_ELEMENT"),
+ v8::Int32::New(element_size));
return array;
}
« no previous file with comments | « no previous file | test/mjsunit/external-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698