Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1488)

Unified Diff: src/runtime/runtime-object.cc

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: more tests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 707b05e57b756ccffc0b9ba422b0f2c0b1fde14a..f75f02e92b0d3dd3d094179413e16e868464cb16 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -182,9 +182,14 @@ 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()) {
+ THROW_NEW_ERROR_RETURN_FAILURE(
+ isolate, NewTypeError(MessageTemplate::kProxyHandlerNonObject));
+ }
return *obj;
}
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime/runtime-proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698