@@ -364,6 +364,16 @@ class Assert {
364
364
return NO_EXCEPTION_SENTINEL ;
365
365
}
366
366
367
+ #getActual( fn ) {
368
+ validateFunction ( fn , 'fn' ) ;
369
+ try {
370
+ fn ( ) ;
371
+ } catch ( e ) {
372
+ return e ;
373
+ }
374
+ return NO_EXCEPTION_SENTINEL ;
375
+ }
376
+
367
377
/**
368
378
* Pure assertion tests whether a value is truthy, as determined
369
379
* by !!value.
@@ -662,7 +672,7 @@ class Assert {
662
672
* @returns {void }
663
673
*/
664
674
throws ( promiseFn , ...args ) {
665
- this . #expectsError( Assert . prototype . throws , getActual ( promiseFn ) , ...args ) ;
675
+ this . #expectsError( Assert . prototype . throws , this . # getActual( promiseFn ) , ...args ) ;
666
676
} ;
667
677
668
678
/**
@@ -682,7 +692,7 @@ class Assert {
682
692
* @returns {void }
683
693
*/
684
694
doesNotThrow ( fn , ...args ) {
685
- this . #expectsNoError( Assert . prototype . doesNotThrow , getActual ( fn ) , ...args ) ;
695
+ this . #expectsNoError( Assert . prototype . doesNotThrow , this . # getActual( fn ) , ...args ) ;
686
696
} ;
687
697
688
698
/**
@@ -798,16 +808,6 @@ class Comparison {
798
808
}
799
809
}
800
810
801
- function getActual ( fn ) {
802
- validateFunction ( fn , 'fn' ) ;
803
- try {
804
- fn ( ) ;
805
- } catch ( e ) {
806
- return e ;
807
- }
808
- return NO_EXCEPTION_SENTINEL ;
809
- }
810
-
811
811
function checkIsPromise ( obj ) {
812
812
// Accept native ES6 promises and promises that are implemented in a similar
813
813
// way. Do not accept thenables that use a function as `obj` and that have no
0 commit comments