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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 // created error object, use that name property. Otherwise just use the | 410 // created error object, use that name property. Otherwise just use the |
411 // constructor name to avoid triggering possible side effects. | 411 // constructor name to avoid triggering possible side effects. |
412 // Similar for the message property. If the message property shadows the | 412 // Similar for the message property. If the message property shadows the |
413 // internally created error object, use that message property. Otherwise | 413 // internally created error object, use that message property. Otherwise |
414 // use empty string as message. | 414 // use empty string as message. |
415 LookupIterator name_lookup(error, name_string, | 415 LookupIterator name_lookup(error, name_string, |
416 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 416 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
417 if (internal_error_lookup.IsFound() && | 417 if (internal_error_lookup.IsFound() && |
418 !ShadowsInternalError(isolate, &name_lookup, &internal_error_lookup)) { | 418 !ShadowsInternalError(isolate, &name_lookup, &internal_error_lookup)) { |
419 Handle<JSObject> holder = internal_error_lookup.GetHolder<JSObject>(); | 419 Handle<JSObject> holder = internal_error_lookup.GetHolder<JSObject>(); |
420 name = Handle<String>(holder->constructor_name()); | 420 name = JSReceiver::GetConstructorName(holder); |
421 } else { | 421 } else { |
422 ASSIGN_RETURN_ON_EXCEPTION( | 422 ASSIGN_RETURN_ON_EXCEPTION( |
423 isolate, name, | 423 isolate, name, |
424 GetStringifiedProperty(isolate, &name_lookup, | 424 GetStringifiedProperty(isolate, &name_lookup, |
425 isolate->factory()->Error_string()), | 425 isolate->factory()->Error_string()), |
426 String); | 426 String); |
427 } | 427 } |
428 | 428 |
429 LookupIterator message_lookup( | 429 LookupIterator message_lookup( |
430 error, message_string, LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); | 430 error, message_string, LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (obj->IsUndefined()) return default_value; | 475 if (obj->IsUndefined()) return default_value; |
476 if (!obj->IsString()) { | 476 if (!obj->IsString()) { |
477 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), | 477 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), |
478 String); | 478 String); |
479 } | 479 } |
480 return Handle<String>::cast(obj); | 480 return Handle<String>::cast(obj); |
481 } | 481 } |
482 | 482 |
483 } // namespace internal | 483 } // namespace internal |
484 } // namespace v8 | 484 } // namespace v8 |
OLD | NEW |