1
+ ( function ( ) {
2
+ var __extends_ts = function ( d , b ) {
3
+ for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
4
+ function __ ( ) { this . constructor = d ; }
5
+ __ . prototype = b . prototype ;
6
+ d . prototype = new __ ( ) ;
7
+ } ;
8
+
9
+ var __decorate = ( this && this . __decorate ) || function ( decorators , target , key , desc ) {
10
+ var c = arguments . length ;
11
+ var r = c < 3 ? target : desc === null ? desc = Object . getOwnPropertyDescriptor ( target , key ) : desc , d ;
12
+
13
+ if ( typeof global . Reflect === "object" && typeof global . Reflect . decorate === "function" ) {
14
+ r = global . Reflect . decorate ( decorators , target , key , desc ) ;
15
+ }
16
+ else {
17
+ for ( var i = decorators . length - 1 ; i >= 0 ; i -- ) {
18
+ if ( d = decorators [ i ] ) {
19
+ r = ( c < 3 ? d ( r ) : c > 3 ? d ( target , key , r ) : d ( target , key ) ) || r ;
20
+ }
21
+ }
22
+ }
23
+ return c > 3 && r && Object . defineProperty ( target , key , r ) , r ;
24
+ } ;
25
+
26
+ var __native = function ( thiz ) {
27
+ var result = thiz . __proto__ ;
28
+
29
+ for ( var prop in thiz )
30
+ {
31
+ if ( thiz . hasOwnProperty ( prop ) )
32
+ {
33
+ thiz . __proto__ [ prop ] = thiz [ prop ] ;
34
+ delete thiz [ prop ] ;
35
+ }
36
+ }
37
+
38
+ thiz . constructor = undefined ;
39
+ thiz . __proto__ = undefined ;
40
+ Object . freeze ( thiz ) ;
41
+ Object . preventExtensions ( thiz )
42
+ return result ;
43
+ } ;
44
+
45
+ var __extends = function ( Child , Parent ) {
46
+
47
+ if ( Parent . extend ) {
48
+ if ( Parent . __isPrototypeImplementationObject ) {
49
+ throw new Error ( "Can not extend an already extended native object." ) ;
50
+ }
51
+
52
+ function extend ( child , parent ) {
53
+ __log ( "TS extend called" ) ;
54
+ if ( ! child . __extended ) {
55
+ child . __extended = parent . extend ( child . name , child . prototype ) ;
56
+ }
57
+
58
+ return child . __extended ;
59
+ } ;
60
+
61
+ Parent . __activityExtend = function ( parent , name , implementationObject ) {
62
+ __log ( "__activityExtend called" ) ;
63
+ return parent . extend ( name , implementationObject ) ;
64
+ } ;
65
+
66
+ Parent . call = function ( thiz ) {
67
+ var Extended = extend ( thiz . __proto__ . __child , thiz . __proto__ . __parent ) ;
68
+ if ( arguments . length > 1 )
69
+ {
70
+ thiz . __proto__ = new ( Function . prototype . bind . apply ( Extended , [ null ] . concat ( Array . prototype . slice . call ( arguments , 1 ) ) ) ) ;
71
+ }
72
+ else
73
+ {
74
+ thiz . __proto__ = new Extended ( ) ;
75
+ }
76
+ } ;
77
+
78
+ Parent . apply = function ( thiz , args ) {
79
+ var Extended = extend ( thiz . __proto__ . __child , thiz . __proto__ . __parent ) ;
80
+ if ( args && args . length > 0 )
81
+ {
82
+ thiz . __proto__ = new ( Function . prototype . bind . apply ( Extended , [ null ] . concat ( args ) ) ) ;
83
+ }
84
+ else
85
+ {
86
+ thiz . __proto__ = new Extended ( ) ;
87
+ }
88
+ } ;
89
+ }
90
+
91
+ __extends_ts ( Child , Parent ) ;
92
+
93
+
94
+ if ( Parent . extend ) {
95
+ Child . __isPrototypeImplementationObject = true ;
96
+ Child . __proto__ = Parent ;
97
+ Child . prototype . __parent = Parent ;
98
+ Child . prototype . __child = Child ;
99
+ }
100
+ }
101
+
102
+ function JavaProxy ( className ) {
103
+ return function ( target ) {
104
+ var extended = target . extend ( className , target . prototype )
105
+ extended . name = className ;
106
+ return extended ;
107
+ } ;
108
+ }
109
+
110
+ function Interfaces ( interfacesArr ) {
111
+ return function ( target ) {
112
+ if ( interfacesArr instanceof Array ) {
113
+ // attach interfaces: [] to the object
114
+ target . prototype . interfaces = interfacesArr ;
115
+ }
116
+ }
117
+ }
118
+
119
+ global . __native = __native ;
120
+ global . __extends = __extends ;
121
+ global . __decorate = __decorate ;
122
+ global . JavaProxy = JavaProxy ;
123
+ global . Interfaces = Interfaces ;
124
+ } ) ( )
0 commit comments