OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/messages.h" | 5 #include "src/messages.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/execution.h" | 8 #include "src/execution.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/string-builder.h" | 10 #include "src/string-builder.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (accessors->IsAccessorPair()) { | 216 if (accessors->IsAccessorPair()) { |
217 Handle<AccessorPair> pair = Handle<AccessorPair>::cast(accessors); | 217 Handle<AccessorPair> pair = Handle<AccessorPair>::cast(accessors); |
218 return pair->getter() == *fun || pair->setter() == *fun; | 218 return pair->getter() == *fun || pair->setter() == *fun; |
219 } | 219 } |
220 } | 220 } |
221 return false; | 221 return false; |
222 } | 222 } |
223 | 223 |
224 | 224 |
225 Handle<Object> CallSite::GetMethodName() { | 225 Handle<Object> CallSite::GetMethodName() { |
226 MaybeHandle<JSReceiver> maybe = Object::ToObject(isolate_, receiver_); | 226 if (receiver_->IsNull() || receiver_->IsUndefined()) { |
227 Handle<JSReceiver> receiver; | 227 return isolate_->factory()->null_value(); |
228 if (!maybe.ToHandle(&receiver) || !receiver->IsJSObject()) { | 228 } |
| 229 Handle<JSReceiver> receiver = |
| 230 Object::ToObject(isolate_, receiver_).ToHandleChecked(); |
| 231 if (!receiver->IsJSObject()) { |
229 return isolate_->factory()->null_value(); | 232 return isolate_->factory()->null_value(); |
230 } | 233 } |
231 | 234 |
232 Handle<JSObject> obj = Handle<JSObject>::cast(receiver); | 235 Handle<JSObject> obj = Handle<JSObject>::cast(receiver); |
233 Handle<Object> function_name(fun_->shared()->name(), isolate_); | 236 Handle<Object> function_name(fun_->shared()->name(), isolate_); |
234 if (function_name->IsName()) { | 237 if (function_name->IsName()) { |
235 Handle<Name> name = Handle<Name>::cast(function_name); | 238 Handle<Name> name = Handle<Name>::cast(function_name); |
236 if (CheckMethodName(isolate_, obj, name, fun_, | 239 if (CheckMethodName(isolate_, obj, name, fun_, |
237 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR)) | 240 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR)) |
238 return name; | 241 return name; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 builder.AppendCharacter(*c); | 400 builder.AppendCharacter(*c); |
398 } | 401 } |
399 } | 402 } |
400 | 403 |
401 return builder.Finish(); | 404 return builder.Finish(); |
402 } | 405 } |
403 | 406 |
404 | 407 |
405 } // namespace internal | 408 } // namespace internal |
406 } // namespace v8 | 409 } // namespace v8 |
OLD | NEW |