v a r   k e y , M o d u l e = v o i d   0 ! = = M o d u l e ? M o d u l e : { } , m o d u l e O v e r r i d e s = { } ; f o r ( k e y   i n   M o d u l e ) M o d u l e . h a s O w n P r o p e r t y ( k e y ) & & ( m o d u l e O v e r r i d e s [ k e y ] = M o d u l e [ k e y ] ) ; v a r   r e a d _ , r e a d A s y n c , r e a d B i n a r y , s e t W i n d o w T i t l e , a r g u m e n t s _ = [ ] , t h i s P r o g r a m = " . / t h i s . p r o g r a m " , q u i t _ = f u n c t i o n ( e , n ) { t h r o w   n } , E N V I R O N M E N T _ I S _ W E B = ! 0 , E N V I R O N M E N T _ I S _ W O R K E R = ! 1 , s c r i p t D i r e c t o r y = " " ; f u n c t i o n   l o c a t e F i l e ( e ) { r e t u r n   M o d u l e . l o c a t e F i l e ? M o d u l e . l o c a t e F i l e ( e , s c r i p t D i r e c t o r y ) : s c r i p t D i r e c t o r y + e } ( E N V I R O N M E N T _ I S _ W E B | | E N V I R O N M E N T _ I S _ W O R K E R ) & & ( E N V I R O N M E N T _ I S _ W O R K E R ? s c r i p t D i r e c t o r y = s e l f . l o c a t i o n . h r e f : " u n d e f i n e d " ! = t y p e o f   d o c u m e n t & & d o c u m e n t . c u r r e n t S c r i p t & & ( s c r i p t D i r e c t o r y = d o c u m e n t . c u r r e n t S c r i p t . s r c ) , s c r i p t D i r e c t o r y = 0 ! = = s c r i p t D i r e c t o r y . i n d e x O f ( " b l o b : " ) ? s c r i p t D i r e c t o r y . s u b s t r ( 0 , s c r i p t D i r e c t o r y . l a s t I n d e x O f ( " / " ) + 1 ) : " " , r e a d _ = f u n c t i o n ( e ) { v a r   n = n e w   X M L H t t p R e q u e s t ; r e t u r n   n . o p e n ( " G E T " , e , ! 1 ) , n . s e n d ( n u l l ) , n . r e s p o n s e T e x t } , E N V I R O N M E N T _ I S _ W O R K E R & & ( r e a d B i n a r y = f u n c t i o n ( e ) { v a r   n = n e w   X M L H t t p R e q u e s t ; r e t u r n   n . o p e n ( " G E T " , e , ! 1 ) , n . r e s p o n s e T y p e = " a r r a y b u f f e r " , n . s e n d ( n u l l ) , n e w   U i n t 8 A r r a y ( n . r e s p o n s e ) } ) , r e a d A s y n c = f u n c t i o n ( e , n , t ) { v a r   r = n e w   X M L H t t p R e q u e s t ; r . o p e n ( " G E T " , e , ! 0 ) , r . r e s p o n s e T y p e = " a r r a y b u f f e r " , r . o n l o a d = f u n c t i o n ( ) { 2 0 0 = = r . s t a t u s | | 0 = = r . s t a t u s & & r . r e s p o n s e ? n ( r . r e s p o n s e ) : t ( ) } , r . o n e r r o r = t , r . s e n d ( n u l l ) } , s e t W i n d o w T i t l e = f u n c t i o n ( e ) { d o c u m e n t . t i t l e = e } ) ; v a r   w a s m B i n a r y , o u t = M o d u l e . p r i n t | | c o n s o l e . l o g . b i n d ( c o n s o l e ) , e r r = M o d u l e . p r i n t E r r | | c o n s o l e . w a r n . b i n d ( c o n s o l e ) ; f o r ( k e y   i n   m o d u l e O v e r r i d e s ) m o d u l e O v e r r i d e s . h a s O w n P r o p e r t y ( k e y ) & & ( M o d u l e [ k e y ] = m o d u l e O v e r r i d e s [ k e y ] ) ; m o d u l e O v e r r i d e s = n u l l , M o d u l e . a r g u m e n t s & & ( a r g u m e n t s _ = M o d u l e . a r g u m e n t s ) , M o d u l e . t h i s P r o g r a m & & ( t h i s P r o g r a m = M o d u l e . t h i s P r o g r a m ) , M o d u l e . q u i t & & ( q u i t _ = M o d u l e . q u i t ) , M o d u l e . w a s m B i n a r y & & ( w a s m B i n a r y = M o d u l e . w a s m B i n a r y ) ; v a r   w a s m M e m o r y , n o E x i t R u n t i m e = M o d u l e . n o E x i t R u n t i m e | | ! 0 ; " o b j e c t " ! = t y p e o f   W e b A s s e m b l y & & a b o r t ( " n o   n a t i v e   w a s m   s u p p o r t   d e t e c t e d " ) ; v a r   E X I T S T A T U S , b u f f e r , H E A P 8 , H E A P U 8 , H E A P 1 6 , H E A P U 1 6 , H E A P 3 2 , H E A P U 3 2 , H E A P F 3 2 , H E A P F 6 4 , A B O R T = ! 1 ; f u n c t i o n   u p d a t e G l o b a l B u f f e r A n d V i e w s ( e ) { b u f f e r = e , M o d u l e . H E A P 8 = H E A P 8 = n e w   I n t 8 A r r a y ( e ) , M o d u l e . H E A P 1 6 = H E A P 1 6 = n e w   I n t 1 6 A r r a y ( e ) , M o d u l e . H E A P 3 2 = H E A P 3 2 = n e w   I n t 3 2 A r r a y ( e ) , M o d u l e . H E A P U 8 = H E A P U 8 = n e w   U i n t 8 A r r a y ( e ) , M o d u l e . H E A P U 1 6 = H E A P U 1 6 = n e w   U i n t 1 6 A r r a y ( e ) , M o d u l e . H E A P U 3 2 = H E A P U 3 2 = n e w   U i n t 3 2 A r r a y ( e ) , M o d u l e . H E A P F 3 2 = H E A P F 3 2 = n e w   F l o a t 3 2 A r r a y ( e ) , M o d u l e . H E A P F 6 4 = H E A P F 6 4 = n e w   F l o a t 6 4 A r r a y ( e ) } v a r   w a s m T a b l e , I N I T I A L _ M E M O R Y = M o d u l e . I N I T I A L _ M E M O R Y | | 7 3 4 0 0 3 2 0 0 , _ _ A T P R E R U N _ _ = [ ] , _ _ A T I N I T _ _ = [ ] , _ _ A T M A I N _ _ = [ ] , _ _ A T P O S T R U N _ _ = [ ] , r u n t i m e I n i t i a l i z e d = ! 1 , r u n t i m e E x i t e d = ! 1 ; f u n c t i o n   p r e R u n ( ) { i f ( M o d u l e . p r e R u n ) f o r ( " f u n c t i o n " = = t y p e o f   M o d u l e . p r e R u n & & ( M o d u l e . p r e R u n = [ M o d u l e . p r e R u n ] ) ; M o d u l e . p r e R u n . l e n g t h ; ) a d d O n P r e R u n ( M o d u l e . p r e R u n . s h i f t ( ) ) ; c a l l R u n t i m e C a l l b a c k s ( _ _ A T P R E R U N _ _ ) } f u n c t i o n   i n i t R u n t i m e ( ) { r u n t i m e I n i t i a l i z e d = ! 0 , c a l l R u n t i m e C a l l b a c k s ( _ _ A T I N I T _ _ ) } f u n c t i o n   p r e M a i n ( ) { c a l l R u n t i m e C a l l b a c k s ( _ _ A T M A I N _ _ ) } f u n c t i o n   e x i t R u n t i m e ( ) { r u n t i m e E x i t e d = ! 0 } f u n c t i o n   p o s t R u n ( ) { i f ( M o d u l e . p o s t R u n ) f o r ( " f u n c t i o n " = = t y p e o f   M o d u l e . p o s t R u n & & ( M o d u l e . p o s t R u n = [ M o d u l e . p o s t R u n ] ) ; M o d u l e . p o s t R u n . l e n g t h ; ) a d d O n P o s t R u n ( M o d u l e . p o s t R u n . s h i f t ( ) ) ; c a l l R u n t i m e C a l l b a c k s ( _ _ A T P O S T R U N _ _ ) } f u n c t i o n   a d d O n P r e R u n ( e ) { _ _ A T P R E R U N _ _ . u n s h i f t ( e ) } f u n c t i o n   a d d O n P o s t R u n ( e ) { _ _ A T P O S T R U N _ _ . u n s h i f t ( e ) } _ _ A T I N I T _ _ . p u s h ( { f u n c : f u n c t i o n ( ) { _ _ _ w a s m _ c a l l _ c t o r s ( ) } } ) ; v a r   r u n D e p e n d e n c i e s = 0 , r u n D e p e n d e n c y W a t c h e r = n u l l , d e p e n d e n c i e s F u l f i l l e d = n u l l ; f u n c t i o n   a d d R u n D e p e n d e n c y ( e ) { r u n D e p e n d e n c i e s + + , M o d u l e . m o n i t o r R u n D e p e n d e n c i e s & & M o d u l e . m o n i t o r R u n D e p e n d e n c i e s ( r u n D e p e n d e n c i e s ) } f u n c t i o n   r e m o v e R u n D e p e n d e n c y ( e ) { i f ( r u n D e p e n d e n c i e s - - , M o d u l e . m o n i t o r R u n D e p e n d e n c i e s & & M o d u l e . m o n i t o r R u n D e p e n d e n c i e s ( r u n D e p e n d e n c i e s ) , 0 = = r u n D e p e n d e n c i e s & & ( n u l l ! = = r u n D e p e n d e n c y W a t c h e r & & ( c l e a r I n t e r v a l ( r u n D e p e n d e n c y W a t c h e r ) , r u n D e p e n d e n c y W a t c h e r = n u l l ) , d e p e n d e n c i e s F u l f i l l e d ) ) { v a r   n = d e p e n d e n c i e s F u l f i l l e d ; d e p e n d e n c i e s F u l f i l l e d = n u l l , n ( ) } } f u n c t i o n   a b o r t ( e ) { t h r o w   M o d u l e . o n A b o r t & & M o d u l e . o n A b o r t ( e ) , e r r ( e + = " " ) , A B O R T = ! 0 , E X I T S T A T U S = 1 , e = " a b o r t ( " + e + " ) .   B u i l d   w i t h   - s   A S S E R T I O N S = 1   f o r   m o r e   i n f o . " , n e w   W e b A s s e m b l y . R u n t i m e E r r o r ( e ) } f u n c t i o n   h a s P r e f i x ( e , n ) { r e t u r n   S t r i n g . p r o t o t y p e . s t a r t s W i t h ? e . s t a r t s W i t h ( n ) : 0 = = = e . i n d e x O f ( n ) } M o d u l e . p r e l o a d e d I m a g e s = { } , M o d u l e . p r e l o a d e d A u d i o s = { } ; v a r   d a t a U R I P r e f i x = " d a t a : a p p l i c a t i o n / o c t e t - s t r e a m ; b a s e 6 4 , " ; f u n c t i o n   i s D a t a U R I ( e ) { r e t u r n   h a s P r e f i x ( e , d a t a U R I P r e f i x ) } v a r   w a s m B i n a r y F i l e = " c 1 2 0 . w a s m " ; f u n c t i o n   g e t B i n a r y ( e ) { t r y { i f ( e = = w a s m B i n a r y F i l e & & w a s m B i n a r y ) r e t u r n   n e w   U i n t 8 A r r a y ( w a s m B i n a r y ) ; i f ( r e a d B i n a r y ) r e t u r n   r e a d B i n a r y ( e ) ; t h r o w " b o t h   a s y n c   a n d   s y n c   f e t c h i n g   o f   t h e   w a s m   f a i l e d " } c a t c h ( e ) { a b o r t ( e ) } } f u n c t i o n   g e t B i n a r y P r o m i s e ( ) { r e t u r n   w a s m B i n a r y | | ! E N V I R O N M E N T _ I S _ W E B & & ! E N V I R O N M E N T _ I S _ W O R K E R | | " f u n c t i o n " ! = t y p e o f   f e t c h ? P r o m i s e . r e s o l v e ( ) . t h e n ( ( f u n c t i o n ( ) { r e t u r n   g e t B i n a r y ( w a s m B i n a r y F i l e ) } ) ) : f e t c h ( w a s m B i n a r y F i l e , { c r e d e n t i a l s : " s a m e - o r i g i n " } ) . t h e n ( ( f u n c t i o n ( e ) { i f ( ! e . o k ) t h r o w " f a i l e d   t o   l o a d   w a s m   b i n a r y   f i l e   a t   ' " + w a s m B i n a r y F i l e + " ' " ; r e t u r n   e . a r r a y B u f f e r ( ) } ) ) . c a t c h ( ( f u n c t i o n ( ) { r e t u r n   g e t B i n a r y ( w a s m B i n a r y F i l e ) } ) ) } f u n c t i o n   c r e a t e W a s m ( ) { v a r   e = { a : a s m L i b r a r y A r g } ; f u n c t i o n   n ( e , n ) { v a r   t = e . e x p o r t s ; M o d u l e . a s m = t , u p d a t e G l o b a l B u f f e r A n d V i e w s ( ( w a s m M e m o r y = M o d u l e . a s m . b ) . b u f f e r ) , w a s m T a b l e = M o d u l e . a s m . e , r e m o v e R u n D e p e n d e n c y ( " w a s m - i n s t a n t i a t e " ) } f u n c t i o n   t ( e ) { n ( e . i n s t a n c e ) } f u n c t i o n   r ( n ) { r e t u r n   g e t B i n a r y P r o m i s e ( ) . t h e n ( ( f u n c t i o n ( n ) { r e t u r n   W e b A s s e m b l y . i n s t a n t i a t e ( n , e ) } ) ) . t h e n ( n , ( f u n c t i o n ( e ) { e r r ( " f a i l e d   t o   a s y n c h r o n o u s l y   p r e p a r e   w a s m :   " + e ) , a b o r t ( e ) } ) ) } i f ( a d d R u n D e p e n d e n c y ( " w a s m - i n s t a n t i a t e " ) , M o d u l e . i n s t a n t i a t e W a s m ) t r y { r e t u r n   M o d u l e . i n s t a n t i a t e W a s m ( e , n ) } c a t c h ( e ) { r e t u r n   e r r ( " M o d u l e . i n s t a n t i a t e W a s m   c a l l b a c k   f a i l e d   w i t h   e r r o r :   " + e ) , ! 1 } r e t u r n   w a s m B i n a r y | | " f u n c t i o n " ! = t y p e o f   W e b A s s e m b l y . i n s t a n t i a t e S t r e a m i n g | | i s D a t a U R I ( w a s m B i n a r y F i l e ) | | " f u n c t i o n " ! = t y p e o f   f e t c h ? r ( t ) : f e t c h ( w a s m B i n a r y F i l e , { c r e d e n t i a l s : " s a m e - o r i g i n " } ) . t h e n ( ( f u n c t i o n ( n ) { r e t u r n   W e b A s s e m b l y . i n s t a n t i a t e S t r e a m i n g ( n , e ) . t h e n ( t , ( f u n c t i o n ( e ) { r e t u r n   e r r ( " w a s m   s t r e a m i n g   c o m p i l e   f a i l e d :   " + e ) , e r r ( " f a l l i n g   b a c k   t o   A r r a y B u f f e r   i n s t a n t i a t i o n " ) , r ( t ) } ) ) } ) ) , { } } f u n c t i o n   m a ( ) { l e t   e = d ( ) ; v a r   n , t , r , i , a , o , u , l , s , q ; q = 0 ; f u n c t i o n   d ( ) { t = d o c u m e n t . g e t E l e m e n t B y I d ( " i w i d " ) . i n n e r H T M L , n = d o c u m e n t . g e t E l e m e n t B y I d ( " i h i g " ) . i n n e r H T M L , o w = d o c u m e n t . g e t E l e m e n t B y I d ( " w i d " ) . i n n e r H T M L , o h = d o c u m e n t . g e t E l e m e n t B y I d ( " h i g " ) . i n n e r H T M L ; l e t   e = d o c u m e n t . g e t E l e m e n t B y I d ( " c p " ) , t t = d o c u m e n t . g e t E l e m e n t B y I d ( " w r a p p e r s " ) , c = d o c u m e n t . g e t E l e m e n t B y I d ( " f l i p " ) , m = d o c u m e n t . g e t E l e m e n t B y I d ( " m y v i d e o " ) ; c o n s t   f = d o c u m e n t . g e t E l e m e n t B y I d ( " i m a g " ) . g e t C o n t e x t ( " 2 d " , { c o l o r T y p e : " f l o a t 6 4 " , p r e f e r L o w P o w e r T o H i g h P e r f o r m a n c e : ! 1 , p r e c i s i o n : " h i g h p " , l o g a r i t h m i c D e p t h B u f f e r : ! 0 , a l p h a : ! 0 , d e p t h : ! 0 , s t e n c i l : ! 0 , i m a g e S m o o t h i n g E n a b l e d : ! 0 , p r e s e r v e D r a w i n g B u f f e r : ! 0 , p r e m u l t i p l i e d A l p h a : ! 1 , d e s y n c h r o n i z e d : ! 1 , l o w L a t e n c y : ! 0 , p o w e r P r e f e r e n c e : " h i g h - p e r f o r m a n c e " , a n t i a l i a s : ! 0 , w i l l R e a d F r e q u e n t l y : ! 0 , x r C o m p a t i b l e : ! 1 , m a j o r V e r s i o n : 2 , m i n o r V e r s i o n : 0 } ) ; f . d r a w I m a g e ( m , 0 , 0 , t , n ) ; v a r   y , p = f . g e t I m a g e D a t a ( 0 , 0 , t , n ) , M = f . c r e a t e I m a g e D a t a ( t , n ) , _ = M . d a t a , R = p . d a t a ; f o r ( y = 0 ; y < t * n * 4 ; y + = 4 ) { v a r   E = M a t h . f l o o r ( . 2 1 2 6 * R [ y ] + . 7 1 5 2 * R [ y + 1 ] + . 0 7 2 2 * R [ y + 2 ] ) ; M a t h . f l o o r ( ( R [ y ] + R [ y + 1 ] + R [ y + 2 ] ) / 6 ) , M a t h . f l o o r ( ( R [ y ] + R [ y + 1 ] + R [ y + 2 ] ) / 3 ) ; E > 1 2 8 ? E > 2 3 0 ? ( _ [ y ] = 2 5 5 , _ [ y + 1 ] = 1 0 0 , _ [ y + 2 ] = 0 , _ [ y + 3 ] = 1 4 2 ) : E > 1 7 5 ? ( _ [ y ] = 2 5 5 , _ [ y + 1 ] = 0 , _ [ y + 2 ] = 0 , _ [ y + 3 ] = 1 4 2 ) : E > 1 7 0 ? ( _ [ y ] = 0 , _ [ y + 1 ] = 0 , _ [ y + 2 ] = 2 5 5 , _ [ y + 3 ] = 1 4 2 ) : E > 1 5 5 ? ( _ [ y ] = 0 , _ [ y + 1 ] = 1 0 0 , _ [ y + 2 ] = 2 5 5 , _ [ y + 3 ] = 1 4 2 ) : E > 1 4 0 ? ( _ [ y ] = 2 5 5 , _ [ y + 1 ] = 2 5 5 , _ [ y + 2 ] = 0 , _ [ y + 3 ] = 1 4 2 ) : E > 1 2 8 & & ( _ [ y ] = 1 1 5 , _ [ y + 1 ] = 5 0 , _ [ y + 2 ] = 0 , _ [ y + 3 ] = 1 4 2 ) : ( _ [ y ] = 0 , _ [ y + 1 ] = 0 , _ [ y + 2 ] = 0 , _ [ y + 3 ] = 2 5 5 ) } f . p u t I m a g e D a t a ( M , 0 , 0 ) , i = d o c u m e n t . g e t E l e m e n t B y I d ( " r r a " ) , r = d o c u m e n t . g e t E l e m e n t B y I d ( " m a i n r " ) , a = d o c u m e n t . g e t E l e m e n t B y I d ( " r r b " ) , o = d o c u m e n t . g e t E l e m e n t B y I d ( " r r c " ) , d o c u m e n t . g e t E l e m e n t B y I d ( " r r a b " ) , d o c u m e n t . g e t E l e m e n t B y I d ( " r r b b " ) , d o c u m e n t . g e t E l e m e n t B y I d ( " r r c b " ) , r a t e = r . i n n e r H T M L , u = 0 , l = 0 , s = 0 ; d o c u m e n t . g e t E l e m e n t B y I d ( " t e m p t i m e " ) . i n n e r H T M L ; l e t   w = ! 1 ; r e t u r n   f u n c t i o n   n ( ) { q = . 8 - q ; t t . s t y l e . o p a c i t y = q ; v a r   t ; w | | ( u - o . i n n e r H T M L < 0 ? u = u + 3 6 0 - o . i n n e r H T M L : u - = o . i n n e r H T M L , t = u , e . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m :   r o t a t e ( " + t + " d e g ) ; " ) , l - a . i n n e r H T M L < 0 ? l = l + 3 6 0 - a . i n n e r H T M L : l - = a . i n n e r H T M L , s e t T i m e o u t ( ( f u n c t i o n ( ) { q = 1 - q ; t t . s t y l e . o p a c i t y = q ; v a r   n ; c . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m :   s c a l e X ( - 1 ) ; " ) , e . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m :   s c a l e Y ( - 1 ) ; " ) , n = l , e . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m : r o t a t e ( " + n + " d e g ) ; " ) } ) , r a t e ) , s + i . i n n e r H T M L > 3 6 0 ? s = s + i . i n n e r H T M L - 3 6 0 : s + = i . i n n e r H T M L , s e t T i m e o u t ( ( f u n c t i o n ( ) { q = . 6 - q ; t t . s t y l e . o p a c i t y = q ; v a r   n ; c . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m :   s c a l e X ( 1 ) ; " ) , e . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m :   s c a l e Y ( 1 ) ; " ) , n = s , e . s e t A t t r i b u t e ( " s t y l e " , " t r a n s f o r m :   r o t a t e ( " + n + " d e g ) ; " ) } ) , r a t e ) , s e t T i m e o u t ( ( f u n c t i o n ( ) { n ( ) } ) , r a t e ) ) } ( ) , d o c u m e n t . g e t E l e m e n t B y I d ( " d i " ) . o n c l i c k = f u n c t i o n ( ) { w = ! 0 , d ( ) } , ( ) = > { w = ! 0 } } e & & e ( ) , e = d ( ) } f u n c t i o n   c a l l R u n t i m e C a l l b a c k s ( e ) { f o r ( ; e . l e n g t h > 0 ; ) { v a r   n = e . s h i f t ( ) ; i f ( " f u n c t i o n " ! = t y p e o f   n ) { v a r   t = n . f u n c ; " n u m b e r " = = t y p e o f   t ? v o i d   0 = = = n . a r g ? w a s m T a b l e . g e t ( t ) ( ) : w a s m T a b l e . g e t ( t ) ( n . a r g ) : t ( v o i d   0 = = = n . a r g ? n u l l : n . a r g ) } e l s e   n ( M o d u l e ) } } i s D a t a U R I ( w a s m B i n a r y F i l e ) | | ( w a s m B i n a r y F i l e = l o c a t e F i l e ( w a s m B i n a r y F i l e ) ) ; v a r   c a l l e d R u n , a s m L i b r a r y A r g = { a : m a } , a s m = c r e a t e W a s m ( ) , _ _ _ w a s m _ c a l l _ c t o r s = M o d u l e . _ _ _ w a s m _ c a l l _ c t o r s = f u n c t i o n ( ) { r e t u r n ( _ _ _ w a s m _ c a l l _ c t o r s = M o d u l e . _ _ _ w a s m _ c a l l _ c t o r s = M o d u l e . a s m . c ) . a p p l y ( n u l l , a r g u m e n t s ) } , _ m a i n = M o d u l e . _ m a i n = f u n c t i o n ( ) { r e t u r n ( _ m a i n = M o d u l e . _ m a i n = M o d u l e . a s m . d ) . a p p l y ( n u l l , a r g u m e n t s ) } ; f u n c t i o n   E x i t S t a t u s ( e ) { t h i s . n a m e = " E x i t S t a t u s " , t h i s . m e s s a g e = " P r o g r a m   t e r m i n a t e d   w i t h   e x i t ( " + e + " ) " , t h i s . s t a t u s = e } v a r   c a l l e d M a i n = ! 1 ; f u n c t i o n   c a l l M a i n ( e ) { v a r   n = M o d u l e . _ m a i n ; t r y { e x i t ( n ( 0 , 0 ) , ! 0 ) } c a t c h ( e ) { i f ( e   i n s t a n c e o f   E x i t S t a t u s ) r e t u r n ; i f ( " u n w i n d " = = e ) r e t u r n   v o i d ( n o E x i t R u n t i m e = ! 0 ) ; v a r   t = e ; e & & " o b j e c t " = = t y p e o f   e & & e . s t a c k & & ( t = [ e , e . s t a c k ] ) , e r r ( " e x c e p t i o n   t h r o w n :   " + t ) , q u i t _ ( 1 , e ) } f i n a l l y { c a l l e d M a i n = ! 0 } } f u n c t i o n   r u n ( e ) { f u n c t i o n   n ( ) { c a l l e d R u n | | ( c a l l e d R u n = ! 0 , M o d u l e . c a l l e d R u n = ! 0 , A B O R T | | ( i n i t R u n t i m e ( ) , p r e M a i n ( ) , M o d u l e . o n R u n t i m e I n i t i a l i z e d & & M o d u l e . o n R u n t i m e I n i t i a l i z e d ( ) , s h o u l d R u n N o w & & c a l l M a i n ( e ) , p o s t R u n ( ) ) ) } e = e | | a r g u m e n t s _ , r u n D e p e n d e n c i e s > 0 | | ( p r e R u n ( ) , r u n D e p e n d e n c i e s > 0 | | ( M o d u l e . s e t S t a t u s ? ( M o d u l e . s e t S t a t u s ( " R u n n i n g . . . " ) , s e t T i m e o u t ( ( f u n c t i o n ( ) { s e t T i m e o u t ( ( f u n c t i o n ( ) { M o d u l e . s e t S t a t u s ( " " ) } ) , 1 ) , n ( ) } ) , 1 ) ) : n ( ) ) ) } f u n c t i o n   e x i t ( e , n ) { n & & n o E x i t R u n t i m e & & 0 = = = e | | ( n o E x i t R u n t i m e | | ( E X I T S T A T U S = e , e x i t R u n t i m e ( ) , M o d u l e . o n E x i t & & M o d u l e . o n E x i t ( e ) , A B O R T = ! 0 ) , q u i t _ ( e , n e w   E x i t S t a t u s ( e ) ) ) } i f ( d e p e n d e n c i e s F u l f i l l e d = f u n c t i o n   e ( ) { c a l l e d R u n | | r u n ( ) , c a l l e d R u n | | ( d e p e n d e n c i e s F u l f i l l e d = e ) } , M o d u l e . r u n = r u n , M o d u l e . p r e I n i t ) f o r ( " f u n c t i o n " = = t y p e o f   M o d u l e . p r e I n i t & & ( M o d u l e . p r e I n i t = [ M o d u l e . p r e I n i t ] ) ; M o d u l e . p r e I n i t . l e n g t h > 0 ; ) M o d u l e . p r e I n i t . p o p ( ) ( ) ; v a r   s h o u l d R u n N o w = ! 0 ; M o d u l e . n o I n i t i a l R u n & & ( s h o u l d R u n N o w = ! 1 ) , r u n ( ) ; 