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

Unified Diff: src/api.cc

Issue 7912: Property enumeration (Closed)
Patch Set: Created 12 years, 2 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
« include/v8.h ('K') | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index b4dd60edba382000d89417ac79f99ae905a25017..be8d4efbaf53bd75a436db3903f3dfc5540ae535 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1750,6 +1750,20 @@ Local<Value> v8::Object::GetPrototype() {
}
+Local<Array> v8::Object::GetProperties() {
+ ON_BAILOUT("v8::Object::GetProperties()", return Local<v8::Array>());
+ v8::HandleScope scope;
+ i::Handle<i::JSObject> self = Utils::OpenHandle(this);
+ i::Handle<i::FixedArray> value = i::GetKeysInFixedArrayFor(self);
+ // Because we use caching to speed up enumeration it is important
+ // to never change the result of the basic enumeration function so
+ // we clone the result.
+ i::Handle<i::FixedArray> elms = i::Factory::CopyFixedArray(value);
+ i::Handle<i::JSArray> result = i::Factory::NewJSArrayWithElements(elms);
+ return scope.Close(Utils::ToLocal(result));
+}
+
+
Local<String> v8::Object::ObjectProtoToString() {
ON_BAILOUT("v8::Object::ObjectProtoToString()", return Local<v8::String>());
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
« include/v8.h ('K') | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698