Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 87ee30a85712ccce989bcd5ba8eacf9b95c0d645..73421d9273c241813b901b0353e7381c103525cf 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -183,14 +183,9 @@ RUNTIME_FUNCTION(Runtime_SetPrototype) { |
DCHECK(args.length() == 2); |
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); |
CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
- Maybe<bool> status = |
- JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR); |
- if (status.IsNothing()) return isolate->heap()->exception(); |
- if (!status.FromJust()) { |
- THROW_NEW_ERROR_RETURN_FAILURE( |
- isolate, |
- NewTypeError(MessageTemplate::kProxySetPrototypeFailed, prototype)); |
- } |
+ MAYBE_RETURN( |
+ JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR), |
+ isolate->heap()->exception()); |
return *obj; |
} |