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

Unified Diff: src/builtins.cc

Issue 1605803002: [runtime] Migrate Object.getOwnPropertyNames to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ObjectGetOwnPropertyDescriptor
Patch Set: REBASE Created 4 years, 11 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 | « src/builtins.h ('k') | src/js/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index f47c2b6350861d955b9960f77793e8dabbd0d877..35671d2c4c813c5adccd36ca989e9f101e6cb092 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1566,8 +1566,11 @@ BUILTIN(ObjectFreeze) {
}
-// ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O )
-BUILTIN(ObjectGetOwnPropertySymbols) {
+namespace {
+
+Object* GetOwnPropertyKeys(Isolate* isolate,
+ BuiltinArguments<BuiltinExtraArguments::kNone> args,
+ PropertyFilter filter) {
HandleScope scope(isolate);
Handle<Object> object = args.atOrUndefined(isolate, 1);
Handle<JSReceiver> receiver;
@@ -1575,11 +1578,25 @@ BUILTIN(ObjectGetOwnPropertySymbols) {
Object::ToObject(isolate, object));
Handle<FixedArray> keys;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, keys, JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY,
- SKIP_STRINGS, CONVERT_TO_STRING));
+ isolate, keys, JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, filter,
+ CONVERT_TO_STRING));
return *isolate->factory()->NewJSArrayWithElements(keys);
}
+} // namespace
+
+
+// ES6 section 19.1.2.7 Object.getOwnPropertyNames ( O )
+BUILTIN(ObjectGetOwnPropertyNames) {
+ return GetOwnPropertyKeys(isolate, args, SKIP_SYMBOLS);
+}
+
+
+// ES6 section 19.1.2.8 Object.getOwnPropertySymbols ( O )
+BUILTIN(ObjectGetOwnPropertySymbols) {
+ return GetOwnPropertyKeys(isolate, args, SKIP_STRINGS);
+}
+
// ES6 section 19.1.2.11 Object.isExtensible ( O )
BUILTIN(ObjectIsExtensible) {
« no previous file with comments | « src/builtins.h ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698