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

Side by Side Diff: src/messages.cc

Issue 2175603003: Omit frames up to new target in Error constructor (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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5216.js » ('j') | no next file with comments »
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/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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5216.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698