1
- ( function ( parentScope ) { function constructProxy ( scope , outputs ) {
2
- if ( Object . is ( scope ) ) {
3
- // Should not happen, but just in case fail safely
4
- console . error ( 'Runtime checks: Scope must be an object' , scope , outputs )
5
- return scope
1
+ ( function ( parentScope ) {
2
+ function constructProxy ( scope , outputs ) {
3
+ if ( Object . is ( scope ) ) {
4
+ // Should not happen, but just in case fail safely
5
+ console . error ( 'Runtime checks: Scope must be an object' , scope , outputs )
6
+ return scope
7
+ }
8
+ return new Proxy ( scope , {
9
+ get ( target , property , receiver ) {
10
+ const targetObj = target [ property ]
11
+ if ( typeof targetObj === 'function' ) {
12
+ return ( ...args ) => {
13
+ return Reflect . apply ( target [ property ] , target , args )
14
+ }
15
+ } else {
16
+ if ( typeof property === 'string' && property in outputs ) {
17
+ return Reflect . get ( outputs , property , receiver )
18
+ }
19
+ return Reflect . get ( target , property , receiver )
6
20
}
7
- return new Proxy ( scope , {
8
- get ( target , property , receiver ) {
9
- const targetObj = target [ property ]
10
- if ( typeof targetObj === 'function' ) {
11
- return ( ...args ) => {
12
- return Reflect . apply ( target [ property ] , target , args )
13
- }
14
- } else {
15
- if ( typeof property === 'string' && property in outputs ) {
16
- return Reflect . get ( outputs , property , receiver )
17
- }
18
- return Reflect . get ( target , property , receiver )
19
- }
20
- }
21
- } )
22
- }
23
- let _proxyFor_parentScope_navigator
24
- if ( parentScope ?. navigator === undefined ) {
25
- _proxyFor_parentScope_navigator = Object . bind ( null ) ;
26
- } else {
27
- _proxyFor_parentScope_navigator = parentScope . navigator ;
28
- }
29
-
30
- let parentScope_navigator_userAgent = "testingThisOut" ;
31
-
32
- let _proxyFor_parentScope_navigator_mediaSession
33
- if ( parentScope ?. navigator ?. mediaSession === undefined ) {
34
- _proxyFor_parentScope_navigator_mediaSession = Object . bind ( null ) ;
35
- } else {
36
- _proxyFor_parentScope_navigator_mediaSession = parentScope . navigator . mediaSession ;
37
- }
38
-
39
- let parentScope_navigator_mediaSession_playbackState = "playing" ;
40
-
41
- let _proxyFor_parentScope_navigator_mediaSession_doesNotExist
42
- if ( parentScope ?. navigator ?. mediaSession ?. doesNotExist === undefined ) {
43
- _proxyFor_parentScope_navigator_mediaSession_doesNotExist = Object . bind ( null ) ;
44
- } else {
45
- _proxyFor_parentScope_navigator_mediaSession_doesNotExist = parentScope . navigator . mediaSession . doesNotExist ;
46
- }
47
-
48
- let _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth
49
- if ( parentScope ?. navigator ?. mediaSession ?. doesNotExist ?. depth === undefined ) {
50
- _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth = Object . bind ( null ) ;
51
- } else {
52
- _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth = parentScope . navigator . mediaSession . doesNotExist . depth ;
53
- }
54
-
55
- let _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a
56
- if ( parentScope ?. navigator ?. mediaSession ?. doesNotExist ?. depth ?. a === undefined ) {
57
- _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a = Object . bind ( null ) ;
58
- } else {
59
- _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a = parentScope . navigator . mediaSession . doesNotExist . depth . a ;
60
- }
61
-
62
- let parentScope_navigator_mediaSession_doesNotExist_depth_a_lot = "boop" ;
63
-
64
- let parentScope_navigator_mediaSession_doesNotExist_depth_a = constructProxy ( _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a , { lot : parentScope_navigator_mediaSession_doesNotExist_depth_a_lot } ) ;
65
-
66
- let parentScope_navigator_mediaSession_doesNotExist_depth = constructProxy ( _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth , { a : parentScope_navigator_mediaSession_doesNotExist_depth_a } ) ;
67
-
68
- let parentScope_navigator_mediaSession_doesNotExist = constructProxy ( _proxyFor_parentScope_navigator_mediaSession_doesNotExist , { depth : parentScope_navigator_mediaSession_doesNotExist_depth } ) ;
69
-
70
- let parentScope_navigator_mediaSession = constructProxy ( _proxyFor_parentScope_navigator_mediaSession , { playbackState : parentScope_navigator_mediaSession_playbackState , doesNotExist : parentScope_navigator_mediaSession_doesNotExist } ) ;
71
-
72
- let parentScope_navigator = constructProxy ( _proxyFor_parentScope_navigator , { userAgent : parentScope_navigator_userAgent , mediaSession : parentScope_navigator_mediaSession } ) ;
73
-
74
- let navigator = parentScope_navigator ;
75
-
76
- let _proxyFor_parentScope_document
77
- if ( parentScope ?. document === undefined ) {
78
- _proxyFor_parentScope_document = Object . bind ( null ) ;
79
- } else {
80
- _proxyFor_parentScope_document = parentScope . document ;
81
- }
82
-
83
- let parentScope_document_cookie = "testingThisOut" ;
84
-
85
- let parentScope_document = constructProxy ( _proxyFor_parentScope_document , { cookie : parentScope_document_cookie } ) ;
86
-
87
- let document = parentScope_document ;
88
-
89
- const window = constructProxy ( parentScope , {
90
- navigator : parentScope_navigator ,
91
- document : parentScope_document
92
- } ) ;
93
- const globalThis = constructProxy ( parentScope , {
94
- navigator : parentScope_navigator ,
95
- document : parentScope_document
96
- } ) ;
97
- console . log ( 1 ) } ) ( globalThis )
21
+ }
22
+ } )
23
+ }
24
+ let _proxyFor_parentScope_navigator
25
+ if ( parentScope ?. navigator === undefined ) {
26
+ _proxyFor_parentScope_navigator = Object . bind ( null ) ;
27
+ } else {
28
+ _proxyFor_parentScope_navigator = parentScope . navigator ;
29
+ }
30
+ let parentScope_navigator_userAgent = "testingThisOut" ;
31
+ let _proxyFor_parentScope_navigator_mediaSession
32
+ if ( parentScope ?. navigator ?. mediaSession === undefined ) {
33
+ _proxyFor_parentScope_navigator_mediaSession = Object . bind ( null ) ;
34
+ } else {
35
+ _proxyFor_parentScope_navigator_mediaSession = parentScope . navigator . mediaSession ;
36
+ }
37
+ let parentScope_navigator_mediaSession_playbackState = "playing" ;
38
+ let _proxyFor_parentScope_navigator_mediaSession_doesNotExist
39
+ if ( parentScope ?. navigator ?. mediaSession ?. doesNotExist === undefined ) {
40
+ _proxyFor_parentScope_navigator_mediaSession_doesNotExist = Object . bind ( null ) ;
41
+ } else {
42
+ _proxyFor_parentScope_navigator_mediaSession_doesNotExist = parentScope . navigator . mediaSession . doesNotExist ;
43
+ }
44
+ let _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth
45
+ if ( parentScope ?. navigator ?. mediaSession ?. doesNotExist ?. depth === undefined ) {
46
+ _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth = Object . bind ( null ) ;
47
+ } else {
48
+ _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth = parentScope . navigator . mediaSession . doesNotExist . depth ;
49
+ }
50
+ let _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a
51
+ if ( parentScope ?. navigator ?. mediaSession ?. doesNotExist ?. depth ?. a === undefined ) {
52
+ _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a = Object . bind ( null ) ;
53
+ } else {
54
+ _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a = parentScope . navigator . mediaSession . doesNotExist . depth . a ;
55
+ }
56
+ let parentScope_navigator_mediaSession_doesNotExist_depth_a_lot = "boop" ;
57
+ let parentScope_navigator_mediaSession_doesNotExist_depth_a = constructProxy ( _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth_a , {
58
+ lot : parentScope_navigator_mediaSession_doesNotExist_depth_a_lot
59
+ } ) ;
60
+ let parentScope_navigator_mediaSession_doesNotExist_depth = constructProxy ( _proxyFor_parentScope_navigator_mediaSession_doesNotExist_depth , {
61
+ a : parentScope_navigator_mediaSession_doesNotExist_depth_a
62
+ } ) ;
63
+ let parentScope_navigator_mediaSession_doesNotExist = constructProxy ( _proxyFor_parentScope_navigator_mediaSession_doesNotExist , {
64
+ depth : parentScope_navigator_mediaSession_doesNotExist_depth
65
+ } ) ;
66
+ let parentScope_navigator_mediaSession = constructProxy ( _proxyFor_parentScope_navigator_mediaSession , {
67
+ playbackState : parentScope_navigator_mediaSession_playbackState ,
68
+ doesNotExist : parentScope_navigator_mediaSession_doesNotExist
69
+ } ) ;
70
+ let parentScope_navigator = constructProxy ( _proxyFor_parentScope_navigator , {
71
+ userAgent : parentScope_navigator_userAgent ,
72
+ mediaSession : parentScope_navigator_mediaSession
73
+ } ) ;
74
+ let navigator = parentScope_navigator ;
75
+ let _proxyFor_parentScope_document
76
+ if ( parentScope ?. document === undefined ) {
77
+ _proxyFor_parentScope_document = Object . bind ( null ) ;
78
+ } else {
79
+ _proxyFor_parentScope_document = parentScope . document ;
80
+ }
81
+ let parentScope_document_cookie = "testingThisOut" ;
82
+ let parentScope_document = constructProxy ( _proxyFor_parentScope_document , {
83
+ cookie : parentScope_document_cookie
84
+ } ) ;
85
+ let document = parentScope_document ;
86
+ const window = constructProxy ( parentScope , {
87
+ navigator : parentScope_navigator ,
88
+ document : parentScope_document
89
+ } ) ;
90
+ const globalThis = constructProxy ( parentScope , {
91
+ navigator : parentScope_navigator ,
92
+ document : parentScope_document
93
+ } ) ;
94
+ console . log ( 1 )
95
+ } ) ( globalThis )
0 commit comments