File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,17 @@ describe('TraceKit', function(){
157157 TraceKit . report . subscribe ( subscriptionHandler ) ;
158158 // should work with/without "Uncaught"
159159 window . onerror ( 'Uncaught ReferenceError: foo is undefined' , 'http://example.com' , testLineNo ) ;
160- window . onerror ( 'ReferenceError: foo is undefined' , 'http://example.com' , testLineNo )
160+ window . onerror ( 'ReferenceError: foo is undefined' , 'http://example.com' , testLineNo ) ;
161+ done ( ) ;
162+ } ) ;
163+
164+ it ( 'should separate name, message for default error types on Opera Mini (see #546)' , function ( done ) {
165+ subscriptionHandler = function ( stackInfo , extra ) {
166+ assert . equal ( stackInfo . name , 'ReferenceError' ) ;
167+ assert . equal ( stackInfo . message , 'Undefined variable: foo' ) ;
168+ } ;
169+ TraceKit . report . subscribe ( subscriptionHandler ) ;
170+ window . onerror ( 'Uncaught exception: ReferenceError: Undefined variable: foo' , 'http://example.com' , testLineNo ) ;
161171 done ( ) ;
162172 } ) ;
163173
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ var _slice = [].slice;
2424var UNKNOWN_FUNCTION = '?' ;
2525
2626// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types
27- var ERROR_TYPES_RE = / ^ (?: U n c a u g h t ) ? ( (?: E v a l | I n t e r n a l | R a n g e | R e f e r e n c e | S y n t a x | T y p e | U R I ) E r r o r ) \ : ? ( .* ) $ / ;
27+ var ERROR_TYPES_RE = / ^ (?: U n c a u g h t (?: e x c e p t i o n : ) ? ) ? ( (?: E v a l | I n t e r n a l | R a n g e | R e f e r e n c e | S y n t a x | T y p e | U R I ) E r r o r ) : ? ( .* ) $ / ;
2828
2929function getLocationHref ( ) {
3030 if ( typeof document === 'undefined' )
You can’t perform that action at this time.
0 commit comments