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

Side by Side Diff: src/messages.cc

Issue 1435273002: Fix name shown by devtools for subclasses. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // created error object, use that name property. Otherwise just use the 409 // created error object, use that name property. Otherwise just use the
410 // constructor name to avoid triggering possible side effects. 410 // constructor name to avoid triggering possible side effects.
411 // Similar for the message property. If the message property shadows the 411 // Similar for the message property. If the message property shadows the
412 // internally created error object, use that message property. Otherwise 412 // internally created error object, use that message property. Otherwise
413 // use empty string as message. 413 // use empty string as message.
414 LookupIterator name_lookup(error, name_string, 414 LookupIterator name_lookup(error, name_string,
415 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); 415 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
416 if (internal_error_lookup.IsFound() && 416 if (internal_error_lookup.IsFound() &&
417 !ShadowsInternalError(isolate, &name_lookup, &internal_error_lookup)) { 417 !ShadowsInternalError(isolate, &name_lookup, &internal_error_lookup)) {
418 Handle<JSObject> holder = internal_error_lookup.GetHolder<JSObject>(); 418 Handle<JSObject> holder = internal_error_lookup.GetHolder<JSObject>();
419 name = Handle<String>(holder->constructor_name()); 419 name = JSReceiver::GetConstructorName(holder);
420 } else { 420 } else {
421 ASSIGN_RETURN_ON_EXCEPTION( 421 ASSIGN_RETURN_ON_EXCEPTION(
422 isolate, name, 422 isolate, name,
423 GetStringifiedProperty(isolate, &name_lookup, 423 GetStringifiedProperty(isolate, &name_lookup,
424 isolate->factory()->Error_string()), 424 isolate->factory()->Error_string()),
425 String); 425 String);
426 } 426 }
427 427
428 LookupIterator message_lookup( 428 LookupIterator message_lookup(
429 error, message_string, LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); 429 error, message_string, LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 if (obj->IsUndefined()) return default_value; 474 if (obj->IsUndefined()) return default_value;
475 if (!obj->IsString()) { 475 if (!obj->IsString()) {
476 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), 476 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj),
477 String); 477 String);
478 } 478 }
479 return Handle<String>::cast(obj); 479 return Handle<String>::cast(obj);
480 } 480 }
481 481
482 } // namespace internal 482 } // namespace internal
483 } // namespace v8 483 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698