11function shouldRaise ( f ) {
22 try {
33 f ( ) ;
4- } catch ( e ) { console . log ( "OK" ) ; return }
5- throw new Error ( "should have raised" ) ;
4+ } catch ( e ) {
5+ console . log ( "OK" ) ;
6+ return ;
7+ }
8+ throw new Error ( "should have raised" ) ;
69}
710function shouldNotRaise ( f ) {
811 try {
912 f ( ) ;
1013 console . log ( "OK" ) ;
11- return
12- } catch ( e ) { throw new Error ( "should not have raised" ) ; }
14+ return ;
15+ } catch ( e ) {
16+ throw new Error ( "should not have raised" ) ;
17+ }
1318}
1419
1520// a0, a1 and b are three separate instances.
16- var a0 = require ( ' ./a.js' ) ( global ) ;
17- var a1 = require ( ' ./a.js' ) ( global ) ;
18- var b = require ( ' ./b.js' ) ( global ) ;
21+ var a0 = require ( " ./a.js" ) ( global ) ;
22+ var a1 = require ( " ./a.js" ) ( global ) ;
23+ var b = require ( " ./b.js" ) ( global ) ;
1924shouldNotRaise ( ( ) => a0 . tryWith ( a0 . raise ) ) ;
2025shouldRaise ( ( ) => a1 . tryWith ( a0 . raise ) ) ;
2126shouldRaise ( ( ) => b . tryWith ( a0 . raise ) ) ;
@@ -29,8 +34,8 @@ shouldRaise(() => a1.tryWith(b.raise));
2934shouldNotRaise ( ( ) => b . tryWith ( b . raise ) ) ;
3035
3136// a2 is different from a0,a1 and b
32- var a2 = require ( ' ./a-iife.js' ) ;
33- shouldNotRaise ( ( ) => a2 . tryWith ( a2 . raise ) ) ;
37+ var a2 = require ( " ./a-iife.js" ) ;
38+ shouldNotRaise ( ( ) => a2 . tryWith ( a2 . raise ) ) ;
3439shouldRaise ( ( ) => a0 . tryWith ( a2 . raise ) ) ;
3540shouldRaise ( ( ) => a2 . tryWith ( a0 . raise ) ) ;
3641shouldRaise ( ( ) => a1 . tryWith ( a2 . raise ) ) ;
@@ -39,9 +44,9 @@ shouldRaise(() => b.tryWith(a2.raise));
3944shouldRaise ( ( ) => a2 . tryWith ( b . raise ) ) ;
4045
4146// a3 is the same as a2
42- var a3 = require ( ' ./a-iife.js' ) ;
43- shouldNotRaise ( ( ) => a2 . tryWith ( a3 . raise ) ) ;
44- shouldNotRaise ( ( ) => a3 . tryWith ( a2 . raise ) ) ;
47+ var a3 = require ( " ./a-iife.js" ) ;
48+ shouldNotRaise ( ( ) => a2 . tryWith ( a3 . raise ) ) ;
49+ shouldNotRaise ( ( ) => a3 . tryWith ( a2 . raise ) ) ;
4550shouldRaise ( ( ) => a0 . tryWith ( a3 . raise ) ) ;
4651shouldRaise ( ( ) => a3 . tryWith ( a0 . raise ) ) ;
4752shouldRaise ( ( ) => a1 . tryWith ( a3 . raise ) ) ;
0 commit comments