Skip to content

Commit 0777fd9

Browse files
committed
Rollup of changes: Fixes #66, fixes #77, fixes #85
1 parent 35c3ead commit 0777fd9

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ provided below.
66
The "New" BSD License:
77
----------------------
88

9-
Copyright (c) 2010-2011, The Dojo Foundation
9+
Copyright (c) 2010-2014, The Dojo Foundation
1010
All rights reserved.
1111

1212
Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3737
MIT License
3838
-----------
3939

40-
Copyright (c) 2010-2011, The Dojo Foundation
40+
Copyright (c) 2010-2014, The Dojo Foundation
4141

4242
Permission is hereby granted, free of charge, to any person obtaining a copy
4343
of this software and associated documentation files (the "Software"), to deal

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "text",
3-
"version": "2.0.10",
3+
"version": "2.0.11",
44
"description": "An AMD loader plugin for loading text resources.",
55
"categories": [
66
"Loader plugins"

text.js

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

Comments
 (0)