Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 56c9641d4193afcb5b17bc05c8e6c9992a62d162..3e56ca4f47c5e2fcef0ada9ae69257f7fd420938 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -1638,6 +1638,29 @@ BUILTIN(ReflectIsExtensible) { |
} |
+// ES6 section 26.1.11 Reflect.ownKeys |
+BUILTIN(ReflectOwnKeys) { |
+ HandleScope scope(isolate); |
+ DCHECK_EQ(2, args.length()); |
+ Handle<Object> target = args.at<Object>(1); |
+ |
+ if (!target->IsJSReceiver()) { |
+ THROW_NEW_ERROR_RETURN_FAILURE( |
+ isolate, NewTypeError(MessageTemplate::kCalledOnNonObject, |
+ isolate->factory()->NewStringFromAsciiChecked( |
+ "Reflect.ownKeys"))); |
+ } |
+ |
+ Handle<FixedArray> keys; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, keys, |
+ JSReceiver::GetKeys(Handle<JSReceiver>::cast(target), |
+ JSReceiver::OWN_ONLY, INCLUDE_SYMBOLS, |
+ CONVERT_TO_STRING, IGNORE_ENUMERABILITY)); |
+ return *isolate->factory()->NewJSArrayWithElements(keys); |
+} |
+ |
+ |
// ES6 section 26.1.12 Reflect.preventExtensions |
BUILTIN(ReflectPreventExtensions) { |
HandleScope scope(isolate); |