mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Do not export load in JSXTransformer unless in a browser environment
(cherry picked from commit 795a84d60f)
This commit is contained in:
committed by
Paul O’Shannessy
parent
c362c16e1e
commit
374c3b8a29
Vendored
+5
-5
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user