@@ -60,7 +60,7 @@ function fetchBinary(url, options = {}) {
60
60
} ) ;
61
61
}
62
62
63
- function fetchArray ( instance = { } , baseURL , array , options = { } ) {
63
+ function fetchArray ( instance , baseURL , array , options = { } ) {
64
64
if ( array . ref && ! array . ref . pending ) {
65
65
return new Promise ( ( resolve , reject ) => {
66
66
const url = [
@@ -73,7 +73,7 @@ function fetchArray(instance = {}, baseURL, array, options = {}) {
73
73
xhr . onreadystatechange = ( e ) => {
74
74
if ( xhr . readyState === 1 ) {
75
75
array . ref . pending = true ;
76
- if ( ++ requestCount === 1 && instance . invokeBusy ) {
76
+ if ( ++ requestCount === 1 && instance ? .invokeBusy ) {
77
77
instance . invokeBusy ( true ) ;
78
78
}
79
79
}
@@ -117,10 +117,10 @@ function fetchArray(instance = {}, baseURL, array, options = {}) {
117
117
118
118
// Done with the ref and work
119
119
delete array . ref ;
120
- if ( -- requestCount === 0 && instance . invokeBusy ) {
120
+ if ( -- requestCount === 0 && instance ? .invokeBusy ) {
121
121
instance . invokeBusy ( false ) ;
122
122
}
123
- if ( instance . modified ) {
123
+ if ( instance ? .modified ) {
124
124
instance . modified ( ) ;
125
125
}
126
126
resolve ( array ) ;
@@ -144,18 +144,18 @@ function fetchArray(instance = {}, baseURL, array, options = {}) {
144
144
145
145
// ----------------------------------------------------------------------------
146
146
147
- function fetchJSON ( instance = { } , url , options = { } ) {
147
+ function fetchJSON ( instance , url , options = { } ) {
148
148
return new Promise ( ( resolve , reject ) => {
149
149
const xhr = openAsyncXHR ( 'GET' , url , options ) ;
150
150
151
151
xhr . onreadystatechange = ( e ) => {
152
152
if ( xhr . readyState === 1 ) {
153
- if ( ++ requestCount === 1 && instance . invokeBusy ) {
153
+ if ( ++ requestCount === 1 && instance ? .invokeBusy ) {
154
154
instance . invokeBusy ( true ) ;
155
155
}
156
156
}
157
157
if ( xhr . readyState === 4 ) {
158
- if ( -- requestCount === 0 && instance . invokeBusy ) {
158
+ if ( -- requestCount === 0 && instance ? .invokeBusy ) {
159
159
instance . invokeBusy ( false ) ;
160
160
}
161
161
if ( xhr . status === 200 || xhr . status === 0 ) {
@@ -182,7 +182,7 @@ function fetchJSON(instance = {}, url, options = {}) {
182
182
183
183
// ----------------------------------------------------------------------------
184
184
185
- function fetchText ( instance = { } , url , options = { } ) {
185
+ function fetchText ( instance , url , options = { } ) {
186
186
if ( options && options . compression && options . compression !== 'gz' ) {
187
187
vtkErrorMacro ( 'Supported algorithms are: [gz]' ) ;
188
188
vtkErrorMacro ( `Unkown compression algorithm: ${ options . compression } ` ) ;
@@ -193,12 +193,12 @@ function fetchText(instance = {}, url, options = {}) {
193
193
194
194
xhr . onreadystatechange = ( e ) => {
195
195
if ( xhr . readyState === 1 ) {
196
- if ( ++ requestCount === 1 && instance . invokeBusy ) {
196
+ if ( ++ requestCount === 1 && instance ? .invokeBusy ) {
197
197
instance . invokeBusy ( true ) ;
198
198
}
199
199
}
200
200
if ( xhr . readyState === 4 ) {
201
- if ( -- requestCount === 0 && instance . invokeBusy ) {
201
+ if ( -- requestCount === 0 && instance ? .invokeBusy ) {
202
202
instance . invokeBusy ( false ) ;
203
203
}
204
204
if ( xhr . status === 200 || xhr . status === 0 ) {
@@ -223,7 +223,7 @@ function fetchText(instance = {}, url, options = {}) {
223
223
224
224
// ----------------------------------------------------------------------------
225
225
226
- function fetchImage ( instance = { } , url , options = { } ) {
226
+ function fetchImage ( instance , url , options = { } ) {
227
227
return new Promise ( ( resolve , reject ) => {
228
228
const img = new Image ( ) ;
229
229
if ( options . crossOrigin ) {
0 commit comments