@@ -217,7 +217,7 @@ goog.debug.ErrorHandler.prototype.protectWindowSetInterval = function() {
217
217
*/
218
218
goog . debug . ErrorHandler . prototype . catchUnhandledRejections = function ( win ) {
219
219
'use strict' ;
220
- win = win || goog . global [ 'window' ] ;
220
+ win = win || goog . global [ 'window' ] || goog . global [ 'globalThis' ] ;
221
221
if ( 'onunhandledrejection' in win ) {
222
222
win . onunhandledrejection = ( event ) => {
223
223
// event.reason contains the rejection reason. When an Error is
@@ -238,7 +238,7 @@ goog.debug.ErrorHandler.prototype.catchUnhandledRejections = function(win) {
238
238
goog . debug . ErrorHandler . prototype . protectWindowRequestAnimationFrame =
239
239
function ( ) {
240
240
'use strict' ;
241
- var win = goog . global [ 'window' ] ;
241
+ const win = goog . global [ 'window' ] || goog . global [ 'globalThis '] ;
242
242
var fnNames = [
243
243
'requestAnimationFrame' , 'mozRequestAnimationFrame' , 'webkitAnimationFrame' ,
244
244
'msRequestAnimationFrame'
@@ -261,7 +261,7 @@ goog.debug.ErrorHandler.prototype.protectWindowRequestAnimationFrame =
261
261
goog . debug . ErrorHandler . prototype . protectWindowFunctionsHelper_ = function (
262
262
fnName ) {
263
263
'use strict' ;
264
- var win = goog . global [ 'window' ] ;
264
+ const win = goog . global [ 'window' ] || goog . global [ 'globalThis '] ;
265
265
var originalFn = win [ fnName ] ;
266
266
if ( ! originalFn ) throw new Error ( fnName + ' not on global?' ) ;
267
267
var that = this ;
@@ -328,7 +328,7 @@ goog.debug.ErrorHandler.prototype.setPrefixErrorMessages = function(
328
328
goog . debug . ErrorHandler . prototype . disposeInternal = function ( ) {
329
329
'use strict' ;
330
330
// Try to unwrap window.setTimeout and window.setInterval.
331
- var win = goog . global [ 'window' ] ;
331
+ const win = goog . global [ 'window' ] || goog . global [ 'globalThis '] ;
332
332
win . setTimeout = this . unwrap ( win . setTimeout ) ;
333
333
win . setInterval = this . unwrap ( win . setInterval ) ;
334
334
0 commit comments