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

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, 7 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 | « include/v8.h ('k') | src/property-details.h » ('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 477cebade2520c5fe578fda3a5e85298e653b6b0..3f53b8baf6bd3c04bd50b47ad8279e770a37048d 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))
.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);
« no previous file with comments | « include/v8.h ('k') | src/property-details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698