| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |