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

Unified Diff: src/messages.cc

Issue 1589323002: [runtime] Unify the ToObject handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
« src/builtins.cc ('K') | « src/execution.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 23deb1afebaacfee3d641b75c3fd7d38e612bda1..0365ec88021e0149bb894e565bbf17f6d4fdd3d9 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -223,9 +223,12 @@ bool CheckMethodName(Isolate* isolate, Handle<JSObject> obj, Handle<Name> name,
Handle<Object> CallSite::GetMethodName() {
- MaybeHandle<JSReceiver> maybe = Object::ToObject(isolate_, receiver_);
- Handle<JSReceiver> receiver;
- if (!maybe.ToHandle(&receiver) || !receiver->IsJSObject()) {
+ if (receiver_->IsNull() || receiver_->IsUndefined()) {
+ return isolate_->factory()->null_value();
+ }
+ Handle<JSReceiver> receiver =
+ Object::ToObject(isolate_, receiver_).ToHandleChecked();
+ if (!receiver->IsJSObject()) {
return isolate_->factory()->null_value();
}
« src/builtins.cc ('K') | « src/execution.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698