@@ -8,13 +8,11 @@ Zone.Stacktrace = function (e) {
88 this . _e = e ;
99} ;
1010Zone . Stacktrace . prototype . get = function ( ) {
11- var frames = this . _e . stack . split ( '\n' ) ;
12-
13- var markerIndex ;
14- for ( var markerIndex = frames . length - 1 ; markerIndex >= 0 ; markerIndex -= 1 ) {
15- if ( frames [ markerIndex ] . indexOf ( 'marker@' ) === 0 ) {
16- return frames . slice ( markerIndex + 1 ) . join ( '\n' ) ;
17- }
11+ if ( zone . stackFramesFilter ) {
12+ return this . _e . stack .
13+ split ( '\n' ) .
14+ filter ( zone . stackFramesFilter ) .
15+ join ( '\n' ) ;
1816 }
1917 return this . _e . stack ;
2018}
@@ -46,8 +44,15 @@ Zone.getStacktrace = function () {
4644
4745Zone . longStackTraceZone = {
4846 getLongStacktrace : function ( exception ) {
49- var trace = [ exception . stack ] ;
47+ var trace = [ ] ;
5048 var zone = this ;
49+ if ( zone . stackFramesFilter ) {
50+ trace . push ( exception . stack . split ( '\n' ) .
51+ filter ( zone . stackFramesFilter ) .
52+ join ( '\n' ) ) ;
53+ } else {
54+ trace . push ( exception . stack ) ;
55+ }
5156 var now = Date . now ( ) ;
5257 while ( zone && zone . constructedAtException ) {
5358 trace . push (
@@ -59,6 +64,10 @@ Zone.longStackTraceZone = {
5964 return trace . join ( '\n' ) ;
6065 } ,
6166
67+ stackFramesFilter : function ( line ) {
68+ return line . indexOf ( 'zone.js' ) === - 1 ;
69+ } ,
70+
6271 onError : function ( exception ) {
6372 var reporter = this . reporter || console . log . bind ( console ) ;
6473 reporter ( exception . toString ( ) ) ;
0 commit comments