1
1
/**
2
- * @license RequireJS text 2.0.10 Copyright (c) 2010-2012 , The Dojo Foundation All Rights Reserved.
2
+ * @license RequireJS text 2.0.11 Copyright (c) 2010-2014 , The Dojo Foundation All Rights Reserved.
3
3
* Available via the MIT or new BSD license.
4
4
* see: http://github.com/requirejs/text for details
5
5
*/
@@ -23,7 +23,7 @@ define(['module'], function (module) {
23
23
masterConfig = ( module . config && module . config ( ) ) || { } ;
24
24
25
25
text = {
26
- version : '2.0.10 ' ,
26
+ version : '2.0.11 ' ,
27
27
28
28
strip : function ( content ) {
29
29
//Strips <?xml ...?> declarations so that external SVG and XML
@@ -162,12 +162,12 @@ define(['module'], function (module) {
162
162
163
163
// Do not bother with the work if a build and text will
164
164
// not be inlined.
165
- if ( config . isBuild && ! config . inlineText ) {
165
+ if ( config && config . isBuild && ! config . inlineText ) {
166
166
onLoad ( ) ;
167
167
return ;
168
168
}
169
169
170
- masterConfig . isBuild = config . isBuild ;
170
+ masterConfig . isBuild = config && config . isBuild ;
171
171
172
172
var parsed = text . parseName ( name ) ,
173
173
nonStripName = parsed . moduleName +
@@ -257,7 +257,9 @@ define(['module'], function (module) {
257
257
}
258
258
callback ( file ) ;
259
259
} catch ( e ) {
260
- errback ( e ) ;
260
+ if ( errback ) {
261
+ errback ( e ) ;
262
+ }
261
263
}
262
264
} ;
263
265
} else if ( masterConfig . env === 'xhr' || ( ! masterConfig . env &&
@@ -286,11 +288,13 @@ define(['module'], function (module) {
286
288
//visible via console output in the browser.
287
289
if ( xhr . readyState === 4 ) {
288
290
status = xhr . status ;
289
- if ( status > 399 && status < 600 ) {
291
+ if ( ( status > 399 && status < 600 ) || status === 0 ) {
290
292
//An http 4xx or 5xx error. Signal an error.
291
293
err = new Error ( url + ' HTTP status: ' + status ) ;
292
294
err . xhr = xhr ;
293
- errback ( err ) ;
295
+ if ( errback ) {
296
+ errback ( err ) ;
297
+ }
294
298
} else {
295
299
callback ( xhr . responseText ) ;
296
300
}
@@ -347,7 +351,7 @@ define(['module'], function (module) {
347
351
typeof Components !== 'undefined' && Components . classes &&
348
352
Components . interfaces ) ) {
349
353
//Avert your gaze!
350
- Cc = Components . classes ,
354
+ Cc = Components . classes ;
351
355
Ci = Components . interfaces ;
352
356
Components . utils [ 'import' ] ( 'resource://gre/modules/FileUtils.jsm' ) ;
353
357
xpcIsWindows = ( '@mozilla.org/windows-registry-key;1' in Cc ) ;
0 commit comments