Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index ec1cb6f9c3d4de9bcdd488226dfd5aded3e5b0d3..7f68b922b19cf268cf3bd006a0c697894bcef440 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -2763,6 +2763,25 @@ Local<Array> v8::Object::GetPropertyNames() { |
} |
+Local<Array> v8::Object::GetOwnPropertyNames() { |
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
+ ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyNames()", |
+ return Local<v8::Array>()); |
+ ENTER_V8(isolate); |
+ i::HandleScope scope(isolate); |
+ i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
+ i::Handle<i::FixedArray> value = |
+ i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY); |
+ // 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 = isolate->factory()->CopyFixedArray(value); |
+ i::Handle<i::JSArray> result = |
+ isolate->factory()->NewJSArrayWithElements(elms); |
+ return Utils::ToLocal(scope.CloseAndEscape(result)); |
+} |
+ |
+ |
Local<String> v8::Object::ObjectProtoToString() { |
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
ON_BAILOUT(isolate, "v8::Object::ObjectProtoToString()", |