@@ -109,8 +109,8 @@ const setTopOnError = function (Cypress, cy: $Cy) {
109
109
110
110
// prevent Mocha from setting top.onerror
111
111
Object . defineProperty ( top , 'onerror' , {
112
- set ( ) { } ,
113
- get ( ) { } ,
112
+ set ( ) { } ,
113
+ get ( ) { } ,
114
114
configurable : false ,
115
115
enumerable : true ,
116
116
} )
@@ -131,12 +131,12 @@ const ensureRunnable = (cy, cmd) => {
131
131
interface ICyFocused extends Omit <
132
132
IFocused ,
133
133
'documentHasFocus' | 'interceptFocus' | 'interceptBlur'
134
- > { }
134
+ > { }
135
135
136
136
interface ICySnapshots extends Omit <
137
137
ISnapshots ,
138
138
'onCssModified' | 'onBeforeWindowLoad'
139
- > { }
139
+ > { }
140
140
141
141
export class $Cy extends EventEmitter2 implements ITimeouts , IStability , IAssertions , IRetries , IJQuery , ILocation , ITimer , IChai , IXhr , IAliases , ICySnapshots , ICyFocused {
142
142
id : string
@@ -505,16 +505,16 @@ export class $Cy extends EventEmitter2 implements ITimeouts, IStability, IAssert
505
505
// If the runner can communicate, we should setup all events, otherwise just setup the window and fire the load event.
506
506
if ( isRunnerAbleToCommunicateWithAUT ) {
507
507
if ( this . Cypress . isBrowser ( 'webkit' ) ) {
508
- // WebKit's unhandledrejection event will sometimes not fire within the AUT
509
- // due to a documented bug: https://bugs.webkit.org/show_bug.cgi?id=187822
510
- // To ensure that the event will always fire (and always report these
511
- // unhandled rejections to the user), we patch the AUT's Error constructor
512
- // to enqueue a no-op microtask when executed, which ensures that the unhandledrejection
513
- // event handler will be executed if this Error is uncaught.
508
+ // WebKit's unhandledrejection event will sometimes not fire within the AUT
509
+ // due to a documented bug: https://bugs.webkit.org/show_bug.cgi?id=187822
510
+ // To ensure that the event will always fire (and always report these
511
+ // unhandled rejections to the user), we patch the AUT's Error constructor
512
+ // to enqueue a no-op microtask when executed, which ensures that the unhandledrejection
513
+ // event handler will be executed if this Error is uncaught.
514
514
const originalError = autWindow . Error
515
515
516
516
autWindow . Error = function __CyWebKitError ( ...args ) {
517
- autWindow . queueMicrotask ( ( ) => { } )
517
+ autWindow . queueMicrotask ( ( ) => { } )
518
518
519
519
return originalError . apply ( this , args )
520
520
}
@@ -1059,6 +1059,7 @@ export class $Cy extends EventEmitter2 implements ITimeouts, IStability, IAssert
1059
1059
// eslint-disable-next-line @cypress/dev/arrow-body-multiline-braces
1060
1060
onError : ( handlerType ) => ( event ) => {
1061
1061
const { originalErr, err, promise } = $errUtils . errorFromUncaughtEvent ( handlerType , event ) as ErrorFromProjectRejectionEvent
1062
+
1062
1063
const handled = cy . onUncaughtException ( {
1063
1064
err,
1064
1065
promise,
@@ -1080,7 +1081,7 @@ export class $Cy extends EventEmitter2 implements ITimeouts, IStability, IAssert
1080
1081
onSubmit ( e ) {
1081
1082
return cy . Cypress . action ( 'app:form:submitted' , e )
1082
1083
} ,
1083
- onLoad ( ) { } ,
1084
+ onLoad ( ) { } ,
1084
1085
onBeforeUnload ( e ) {
1085
1086
cy . isStable ( false , 'beforeunload' )
1086
1087
0 commit comments