@@ -387,7 +387,7 @@ var assertThrows = goog.testing.asserts.assertThrows;
387387 */
388388goog . testing . asserts . removeOperaStacktrace_ = function ( e ) {
389389 'use strict' ;
390- if ( ! goog . isObject ( e ) ) return ;
390+ if ( ! e || typeof e != 'object' ) return ;
391391 const stack = e [ 'stacktrace' ] ;
392392 const errorMsg = e [ 'message' ] ;
393393 if ( typeof stack !== 'string' || typeof errorMsg !== 'string' ) {
@@ -513,7 +513,7 @@ goog.testing.asserts.assertRejects = function(a, opt_b) {
513513 var thenable = /** @type {!IThenable<*> } */ ( nonCommentArg ( 1 , 1 , arguments ) ) ;
514514 var comment = commentArg ( 1 , arguments ) ;
515515 _assert (
516- comment , goog . isObject ( thenable ) && typeof thenable . then === 'function' ,
516+ comment , thenable && typeof thenable === 'object' && typeof thenable . then === 'function' ,
517517 ( ) => 'Argument passed to assertRejects is not an IThenable' ) ;
518518
519519 return thenable . then (
@@ -1484,7 +1484,17 @@ var assertSameElements = goog.testing.asserts.assertSameElements;
14841484 */
14851485goog . testing . asserts . isArrayLikeOrIterable_ = function ( obj ) {
14861486 'use strict' ;
1487- return goog . isArrayLike ( obj ) || goog . testing . asserts . isIterable_ ( obj ) ;
1487+ return goog . testing . asserts . isArrayLike_ ( obj ) || goog . testing . asserts . isIterable_ ( obj ) ;
1488+ } ;
1489+
1490+ /**
1491+ * @param {* } obj Object to test.
1492+ * @return {boolean } Whether given object is array-like.
1493+ * @private
1494+ */
1495+ goog . testing . asserts . isArrayLike_ = function ( obj ) {
1496+ 'use strict' ;
1497+ return Array . isArray ( obj ) || obj != null && typeof obj == 'object' && typeof obj . length == 'number'
14881498} ;
14891499
14901500/**
0 commit comments