11/**
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.
33 * Available via the MIT or new BSD license.
44 * see: http://github.com/requirejs/text for details
55 */
@@ -23,7 +23,7 @@ define(['module'], function (module) {
2323 masterConfig = ( module . config && module . config ( ) ) || { } ;
2424
2525 text = {
26- version : '2.0.10 ' ,
26+ version : '2.0.11 ' ,
2727
2828 strip : function ( content ) {
2929 //Strips <?xml ...?> declarations so that external SVG and XML
@@ -162,12 +162,12 @@ define(['module'], function (module) {
162162
163163 // Do not bother with the work if a build and text will
164164 // not be inlined.
165- if ( config . isBuild && ! config . inlineText ) {
165+ if ( config && config . isBuild && ! config . inlineText ) {
166166 onLoad ( ) ;
167167 return ;
168168 }
169169
170- masterConfig . isBuild = config . isBuild ;
170+ masterConfig . isBuild = config && config . isBuild ;
171171
172172 var parsed = text . parseName ( name ) ,
173173 nonStripName = parsed . moduleName +
@@ -257,7 +257,9 @@ define(['module'], function (module) {
257257 }
258258 callback ( file ) ;
259259 } catch ( e ) {
260- errback ( e ) ;
260+ if ( errback ) {
261+ errback ( e ) ;
262+ }
261263 }
262264 } ;
263265 } else if ( masterConfig . env === 'xhr' || ( ! masterConfig . env &&
@@ -286,11 +288,13 @@ define(['module'], function (module) {
286288 //visible via console output in the browser.
287289 if ( xhr . readyState === 4 ) {
288290 status = xhr . status ;
289- if ( status > 399 && status < 600 ) {
291+ if ( ( status > 399 && status < 600 ) || status === 0 ) {
290292 //An http 4xx or 5xx error. Signal an error.
291293 err = new Error ( url + ' HTTP status: ' + status ) ;
292294 err . xhr = xhr ;
293- errback ( err ) ;
295+ if ( errback ) {
296+ errback ( err ) ;
297+ }
294298 } else {
295299 callback ( xhr . responseText ) ;
296300 }
@@ -347,7 +351,7 @@ define(['module'], function (module) {
347351 typeof Components !== 'undefined' && Components . classes &&
348352 Components . interfaces ) ) {
349353 //Avert your gaze!
350- Cc = Components . classes ,
354+ Cc = Components . classes ;
351355 Ci = Components . interfaces ;
352356 Components . utils [ 'import' ] ( 'resource://gre/modules/FileUtils.jsm' ) ;
353357 xpcIsWindows = ( '@mozilla.org/windows-registry-key;1' in Cc ) ;
0 commit comments