Do not export load in JSXTransformer unless in a browser environment

(cherry picked from commit 795a84d60f)
This commit is contained in:
Jakub Malinowski
2013-07-24 14:22:29 -07:00
committed by Paul O’Shannessy
parent c362c16e1e
commit 374c3b8a29
+5 -5
View File
@@ -32,6 +32,11 @@ exports.exec = function(code) {
return eval(transform(code));
};
if (typeof window === "undefined" || window === null) {
return;
}
headEl = document.getElementsByTagName('head')[0];
var run = exports.run = function(code) {
var jsx = docblock.parseAsObject(docblock.extract(code)).jsx;
@@ -42,11 +47,6 @@ var run = exports.run = function(code) {
headEl.appendChild(scriptEl);
};
if (typeof window === "undefined" || window === null) {
return;
}
headEl = document.getElementsByTagName('head')[0];
var load = exports.load = function(url, callback) {
var xhr;
xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP')