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

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

Issue 1492863002: [proxies] Make Object.prototype.isPrototypeOf work with proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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-debug.cc ('k') | test/mjsunit/harmony/proxies-get-prototype-of.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 ad69a1004bf27bb847b8ce5c6fe46427390d690d..57191a8fc31d03cfdc88927d42521c06fe540182 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -1538,18 +1538,20 @@ RUNTIME_FUNCTION(Runtime_InstanceOf) {
NewTypeError(MessageTemplate::kInstanceofNonobjectProto, prototype));
}
// Return whether or not {prototype} is in the prototype chain of {object}.
- return isolate->heap()->ToBoolean(
- object->HasInPrototypeChain(isolate, *prototype));
+ Maybe<bool> result = Object::HasInPrototypeChain(isolate, object, prototype);
+ MAYBE_RETURN(result, isolate->heap()->exception());
+ return isolate->heap()->ToBoolean(result.FromJust());
}
RUNTIME_FUNCTION(Runtime_HasInPrototypeChain) {
- SealHandleScope scope(isolate);
+ HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
- CONVERT_ARG_CHECKED(Object, object, 0);
- CONVERT_ARG_CHECKED(Object, prototype, 1);
- return isolate->heap()->ToBoolean(
- object->HasInPrototypeChain(isolate, prototype));
+ CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1);
+ Maybe<bool> result = Object::HasInPrototypeChain(isolate, object, prototype);
+ MAYBE_RETURN(result, isolate->heap()->exception());
+ return isolate->heap()->ToBoolean(result.FromJust());
}
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | test/mjsunit/harmony/proxies-get-prototype-of.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698