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) { |