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/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/execution.h" | 9 #include "src/execution.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 err, isolate->factory()->message_string(), | 495 err, isolate->factory()->message_string(), |
496 msg_string, DONT_ENUM), | 496 msg_string, DONT_ENUM), |
497 Object); | 497 Object); |
498 } | 498 } |
499 | 499 |
500 // Optionally capture a more detailed stack trace for the message. | 500 // Optionally capture a more detailed stack trace for the message. |
501 if (!suppress_detailed_trace) { | 501 if (!suppress_detailed_trace) { |
502 RETURN_ON_EXCEPTION(isolate, isolate->CaptureAndSetDetailedStackTrace(err), | 502 RETURN_ON_EXCEPTION(isolate, isolate->CaptureAndSetDetailedStackTrace(err), |
503 Object); | 503 Object); |
504 } | 504 } |
| 505 |
| 506 // When we're passed a JSFunction as new target, we can skip frames until that |
| 507 // specific function is seen instead of unconditionally skipping the first |
| 508 // frame. |
| 509 Handle<Object> caller; |
| 510 if (mode == SKIP_FIRST && new_target->IsJSFunction()) { |
| 511 mode = SKIP_UNTIL_SEEN; |
| 512 caller = new_target; |
| 513 } |
| 514 |
505 // Capture a simple stack trace for the stack property. | 515 // Capture a simple stack trace for the stack property. |
506 RETURN_ON_EXCEPTION(isolate, isolate->CaptureAndSetSimpleStackTrace( | 516 RETURN_ON_EXCEPTION(isolate, |
507 err, mode, Handle<Object>()), | 517 isolate->CaptureAndSetSimpleStackTrace(err, mode, caller), |
508 Object); | 518 Object); |
509 | 519 |
510 return err; | 520 return err; |
511 } | 521 } |
512 | 522 |
513 } // namespace internal | 523 } // namespace internal |
514 } // namespace v8 | 524 } // namespace v8 |
OLD | NEW |