File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 143143 * @return Array<String> of function calls, files and line numbers
144144 */
145145 chrome : function ( e ) {
146- var stack = ( e . stack + '\n' )
147- . replace ( / ^ \S [ ^ \( ] + ?[ \n $ ] / gm, '' ) // remove first line
146+ return ( e . stack + '\n' )
148147 . replace ( / ^ \s + ( a t e v a l ) ? a t \s + / gm, '' ) // remove 'at' and indentation
149148 . replace ( / ^ ( [ ^ \( ] + ?) ( [ \n $ ] ) / gm, '{anonymous}() ($1)$2' )
150149 . replace ( / ^ O b j e c t .< a n o n y m o u s > \s * \( ( [ ^ \) ] + ) \) / gm, '{anonymous}() ($1)' )
151150 . replace ( / ^ ( .+ ) \( ( .+ ) \) $ / gm, '$1@$2' )
152- . split ( '\n' ) ;
153- stack . pop ( ) ;
154- return stack ;
151+ . split ( '\n' )
152+ . slice ( 1 , - 1 ) ;
155153 } ,
156154
157155 /**
174172 * @return Array<String> of function calls, files and line numbers
175173 */
176174 ie : function ( e ) {
177- var lineRE = / ^ .* a t ( \w + ) \( ( [ ^ \) ] + ) \) $ / gm;
178- return e . stack . replace ( / a t A n o n y m o u s f u n c t i o n / gm, '{anonymous}()@' )
179- . replace ( / ^ (? = \w + E r r o r \: ) .* $ \n / m, '' )
180- . replace ( lineRE , '$1@$2' )
181- . split ( '\n' ) ;
175+ return e . stack
176+ . replace ( / ^ \s * a t \s + ( .* ) $ / gm, '$1' )
177+ . replace ( / ^ A n o n y m o u s f u n c t i o n \s + / gm, '{anonymous}() ' )
178+ . replace ( / ^ ( .+ ) \s + \( ( .+ ) \) $ / gm, '$1@$2' )
179+ . split ( '\n' )
180+ . slice ( 1 ) ;
182181 } ,
183182
184183 /**
You can’t perform that action at this time.
0 commit comments