Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 707b05e57b756ccffc0b9ba422b0f2c0b1fde14a..3547446975cd9e1b81b3ecd7702fd87699edf011 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -182,9 +182,15 @@ RUNTIME_FUNCTION(Runtime_SetPrototype) { |
DCHECK(args.length() == 2); |
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0); |
CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
- MAYBE_RETURN( |
- JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR), |
- isolate->heap()->exception()); |
+ |
+ Maybe<bool> status = |
+ JSReceiver::SetPrototype(obj, prototype, true, Object::THROW_ON_ERROR); |
+ if (status.IsNothing()) return isolate->heap()->exception(); |
+ if (!status.FromJust()) { |
Camillo Bruni
2015/11/16 13:32:08
We should probably throw the error already in JSPr
|
+ THROW_NEW_ERROR_RETURN_FAILURE( |
+ isolate, NewTypeError(MessageTemplate::kObjectSetPrototypeFailed, obj, |
+ prototype)); |
+ } |
return *obj; |
} |