Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 990f9df5b6409aeef9370f73ac3489a72b1633bf..0a6c1544dd170c806435043cd75c9fd5a620c777 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -1499,6 +1499,23 @@ BUILTIN(ReflectGet) { |
} |
+// ES6 section 26.1.8 Reflect.getPrototypeOf |
+BUILTIN(ReflectGetPrototypeOf) { |
+ 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.getPrototypeOf"))); |
+ } |
+ |
+ return *Object::GetPrototype(isolate, target); |
+} |
+ |
+ |
// ES6 section 26.1.9 Reflect.has |
BUILTIN(ReflectHas) { |
HandleScope scope(isolate); |