Skip to content

Commit

Permalink
Rollup of changes: Fixes #66, fixes #77, fixes #85
Browse files Browse the repository at this point in the history
  • Loading branch information
jrburke committed Apr 14, 2014
1 parent 35c3ead commit 0777fd9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ provided below.
The "New" BSD License:
----------------------

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

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

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

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "text",
"version": "2.0.10",
"version": "2.0.11",
"description": "An AMD loader plugin for loading text resources.",
"categories": [
"Loader plugins"
Expand Down
20 changes: 12 additions & 8 deletions text.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* @license RequireJS text 2.0.11 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
Expand All @@ -23,7 +23,7 @@ define(['module'], function (module) {
masterConfig = (module.config && module.config()) || {};

text = {
version: '2.0.10',
version: '2.0.11',

strip: function (content) {
//Strips <?xml ...?> declarations so that external SVG and XML
Expand Down Expand Up @@ -162,12 +162,12 @@ define(['module'], function (module) {

// Do not bother with the work if a build and text will
// not be inlined.
if (config.isBuild && !config.inlineText) {
if (config && config.isBuild && !config.inlineText) {
onLoad();
return;
}

masterConfig.isBuild = config.isBuild;
masterConfig.isBuild = config && config.isBuild;

var parsed = text.parseName(name),
nonStripName = parsed.moduleName +
Expand Down Expand Up @@ -257,7 +257,9 @@ define(['module'], function (module) {
}
callback(file);
} catch (e) {
errback(e);
if (errback) {
errback(e);
}
}
};
} else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
Expand Down Expand Up @@ -286,11 +288,13 @@ define(['module'], function (module) {
//visible via console output in the browser.
if (xhr.readyState === 4) {
status = xhr.status;
if (status > 399 && status < 600) {
if ((status > 399 && status < 600) || status === 0) {
//An http 4xx or 5xx error. Signal an error.
err = new Error(url + ' HTTP status: ' + status);
err.xhr = xhr;
errback(err);
if (errback) {
errback(err);
}
} else {
callback(xhr.responseText);
}
Expand Down Expand Up @@ -347,7 +351,7 @@ define(['module'], function (module) {
typeof Components !== 'undefined' && Components.classes &&
Components.interfaces)) {
//Avert your gaze!
Cc = Components.classes,
Cc = Components.classes;
Ci = Components.interfaces;
Components.utils['import']('resource://gre/modules/FileUtils.jsm');
xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
Expand Down

0 comments on commit 0777fd9

Please sign in to comment.