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

Unified Diff: src/messages.cc

Issue 2162853003: Simplify and correct logic in CallSite::GetMethodName (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | 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 9809be58571a1b72800dde7ccc926ca58eb3bb6f..c007f069dda69ff51f963f53a6600cb72edec7c2 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -261,15 +261,13 @@ Handle<Object> CallSite::GetMethodName() {
Handle<JSObject> obj = Handle<JSObject>::cast(receiver);
Handle<Object> function_name(fun_->shared()->name(), isolate_);
- if (function_name->IsName()) {
- Handle<Name> name = Handle<Name>::cast(function_name);
+ if (function_name->IsString()) {
+ Handle<String> name = Handle<String>::cast(function_name);
// ES2015 gives getters and setters name prefixes which must
// be stripped to find the property name.
- Handle<String> name_string = Handle<String>::cast(name);
- if (name_string->IsUtf8EqualTo(CStrVector("get "), true) ||
- name_string->IsUtf8EqualTo(CStrVector("set "), true)) {
- name = isolate_->factory()->NewProperSubString(name_string, 4,
- name_string->length());
+ if (name->IsUtf8EqualTo(CStrVector("get "), true) ||
+ name->IsUtf8EqualTo(CStrVector("set "), true)) {
+ name = isolate_->factory()->NewProperSubString(name, 4, name->length());
}
if (CheckMethodName(isolate_, obj, name, fun_,
LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698