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

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

Issue 1417243002: [es6] Partially implement Reflect.setPrototypeOf. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months 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
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/reflect.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 84becb41773663a6ef9b8d3f5a85d73d6a2bae74..ca8cacaf27486b5e8f7d0bb9b91d459b5a3b0d4b 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -164,24 +164,22 @@ RUNTIME_FUNCTION(Runtime_GetPrototype) {
RUNTIME_FUNCTION(Runtime_InternalSetPrototype) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1);
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, JSObject::SetPrototype(obj, prototype, false));
- return *result;
+ MAYBE_RETURN(JSReceiver::SetPrototype(obj, prototype, false, THROW_ON_ERROR),
+ isolate->heap()->exception());
+ return *obj;
}
RUNTIME_FUNCTION(Runtime_SetPrototype) {
HandleScope scope(isolate);
DCHECK(args.length() == 2);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1);
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
- isolate, result, JSObject::SetPrototype(obj, prototype, true));
- return *result;
+ MAYBE_RETURN(JSReceiver::SetPrototype(obj, prototype, true, THROW_ON_ERROR),
+ isolate->heap()->exception());
+ return *obj;
}
@@ -1027,8 +1025,9 @@ static Object* Runtime_NewObjectHelper(Isolate* isolate,
if (original_function->has_instance_prototype()) {
Handle<Object> prototype =
handle(original_function->instance_prototype(), isolate);
- RETURN_FAILURE_ON_EXCEPTION(
- isolate, JSObject::SetPrototype(result, prototype, false));
+ MAYBE_RETURN(
+ JSObject::SetPrototype(result, prototype, false, THROW_ON_ERROR),
+ isolate->heap()->exception());
}
}
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/reflect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698