File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ printStackTrace.implementation.prototype = {
5757 mode : function ( e ) {
5858 if ( e [ 'arguments' ] && e . stack ) {
5959 return 'chrome' ;
60- } else if ( e . message && typeof window !== 'undefined' && window . opera ) {
60+ } else if ( typeof e . message === 'string' && typeof window !== 'undefined' && window . opera ) {
6161 // e.message.indexOf("Backtrace:") > -1 -> opera
6262 // !e.stacktrace -> opera
6363 if ( ! e . stacktrace ) {
@@ -139,6 +139,7 @@ printStackTrace.implementation.prototype = {
139139 } ,
140140
141141 opera11 : function ( e ) {
142+ // "Error thrown at line 42, column 12 in <anonymous function>() in file://localhost/G:/js/stacktrace.js:\n"
142143 // "Error thrown at line 42, column 12 in <anonymous function: createException>() in file://localhost/G:/js/stacktrace.js:\n"
143144 // "called from line 7, column 4 in bar(n) in file://localhost/G:/js/test/functional/testcase1.html:\n"
144145 // "called from line 15, column 3 in file://localhost/G:/js/test/functional/testcase1.html:\n"
@@ -150,7 +151,7 @@ printStackTrace.implementation.prototype = {
150151 if ( match ) {
151152 var location = match [ 4 ] + ':' + match [ 1 ] + ':' + match [ 2 ] ;
152153 var fnName = match [ 3 ] || "global code" ;
153- fnName = fnName . replace ( / < a n o n y m o u s f u n c t i o n : ( \S + ) > / g , "$1" ) ;
154+ fnName = fnName . replace ( / < a n o n y m o u s f u n c t i o n : ( \S + ) > / , "$1" ) . replace ( / < a n o n y m o u s f u n c t i o n > / , ANON ) ;
154155 result . push ( fnName + '@' + location + ' -- ' + lines [ i + 1 ] . replace ( / ^ \s + / , '' ) ) ;
155156 }
156157 }
Original file line number Diff line number Diff line change 2929 if ( UnitTest . prototype . genericError != null ) {
3030 return UnitTest . prototype . genericError ;
3131 }
32+ //return new Error("Generic error");
3233 return new Error ( ) ;
3334 } ,
3435 prepareFakeOperaEnvironment : function ( ) {
496497 expect ( 3 * e . length ) ;
497498 for ( var i = 0 ; i < e . length ; i ++ ) {
498499 var stack = pst . opera11 ( e [ i ] ) , stack_string = stack . join ( '\n' ) ;
499- equals ( stack_string , '' , 'debug' ) ;
500+ equals ( stack_string , 'debug ' , 'debug' ) ;
500501 equals ( stack_string . indexOf ( 'ignored' ) , - 1 , 'ignored' ) ;
501502 equals ( stack [ 5 ] . indexOf ( 'f1(' ) >= 0 , true , 'f1 function name: ' + stack [ 5 ] ) ;
502503 equals ( stack [ 6 ] . indexOf ( '{anonymous}()' ) >= 0 , true , 'f2 is anonymous: ' + stack [ 6 ] ) ;
You can’t perform that action at this time.
0 commit comments