Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index ae707a96aaf9742dbb584443419de83a3c9ec3b6..9a1283957af90ba71b271b50fdee79776c1ed1cb 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -1602,6 +1602,22 @@ BUILTIN(ObjectIsSealed) { |
} |
+// ES6 section 19.1.2.14 Object.keys ( O ) |
+BUILTIN(ObjectKeys) { |
+ HandleScope scope(isolate); |
+ Handle<Object> object = args.atOrUndefined(isolate, 1); |
+ Handle<JSReceiver> receiver; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver, |
+ Execution::ToObject(isolate, object)); |
+ Handle<FixedArray> keys; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
+ isolate, keys, |
+ JSReceiver::GetKeys(receiver, JSReceiver::OWN_ONLY, ENUMERABLE_STRINGS, |
+ CONVERT_TO_STRING)); |
+ return *isolate->factory()->NewJSArrayWithElements(keys); |
+} |
+ |
+ |
// ES6 section 19.1.2.15 Object.preventExtensions ( O ) |
BUILTIN(ObjectPreventExtensions) { |
HandleScope scope(isolate); |