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

Unified Diff: src/api.cc

Issue 1943773002: Add v8::Object::GetOwnPropertyNames(context, filter) method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.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
« 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 1203b01f33dfb8d46b2c1a974d589c4d8eaccf99..0fbbc6964e074fd667780ea046ae28ecac801310 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3901,11 +3901,23 @@ Local<Array> v8::Object::GetPropertyNames() {
MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context) {
+ return GetOwnPropertyNames(
+ context, static_cast<v8::PropertyFilter>(ONLY_ENUMERABLE | SKIP_SYMBOLS));
+}
+
+Local<Array> v8::Object::GetOwnPropertyNames() {
+ auto context = ContextFromHeapObject(Utils::OpenHandle(this));
+ RETURN_TO_LOCAL_UNCHECKED(GetOwnPropertyNames(context), Array);
+}
+
+MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context,
+ PropertyFilter filter) {
PREPARE_FOR_EXECUTION(context, "v8::Object::GetOwnPropertyNames()", Array);
auto self = Utils::OpenHandle(this);
i::Handle<i::FixedArray> value;
has_pending_exception =
- !i::JSReceiver::GetKeys(self, i::OWN_ONLY, i::ENUMERABLE_STRINGS)
+ !i::JSReceiver::GetKeys(self, i::OWN_ONLY,
+ static_cast<i::PropertyFilter>(filter))
Yang 2016/05/03 13:50:20 Please add static checks to property-details.h tha
kozy 2016/05/03 17:37:46 Done.
.ToHandle(&value);
RETURN_ON_FAILED_EXECUTION(Array);
DCHECK(self->map()->EnumLength() == i::kInvalidEnumCacheSentinel ||
@@ -3916,12 +3928,6 @@ MaybeLocal<Array> v8::Object::GetOwnPropertyNames(Local<Context> context) {
}
-Local<Array> v8::Object::GetOwnPropertyNames() {
- auto context = ContextFromHeapObject(Utils::OpenHandle(this));
- RETURN_TO_LOCAL_UNCHECKED(GetOwnPropertyNames(context), Array);
-}
-
-
MaybeLocal<String> v8::Object::ObjectProtoToString(Local<Context> context) {
PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString", String);
auto obj = 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