react-source 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * JSXTransformer v0.4.0
2
+ * JSXTransformer v0.4.1
3
3
  */
4
4
  (function(e){if("function"==typeof bootstrap)bootstrap("jsxtransformer",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeJSXTransformer=e}else"undefined"!=typeof window?window.JSXTransformer=e():global.JSXTransformer=e()})(function(){var define,ses,bootstrap,module,exports;
5
5
  return (function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){
@@ -6886,7 +6886,7 @@ define(function (require, exports, module) {
6886
6886
  var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
6887
6887
  var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
6888
6888
  var mappings = util.getArg(sourceMap, 'mappings');
6889
- var file = util.getArg(sourceMap, 'file');
6889
+ var file = util.getArg(sourceMap, 'file', null);
6890
6890
 
6891
6891
  if (version !== this._version) {
6892
6892
  throw new Error('Unsupported version: ' + version);
@@ -8450,13 +8450,13 @@ module.exports = amdefine;
8450
8450
 
8451
8451
  'use strict';
8452
8452
  var runScripts;
8453
+ var headEl;
8453
8454
 
8454
8455
  var transform = require('./fbtransform/lib/transform').transform;
8455
8456
  var visitors = require('./fbtransform/visitors').transformVisitors;
8456
8457
  var transform = transform.bind(null, visitors.react);
8457
8458
  var docblock = require('./fbtransform/lib/docblock');
8458
8459
 
8459
- var headEl = document.getElementsByTagName('head')[0];
8460
8460
 
8461
8461
  exports.transform = transform;
8462
8462
 
@@ -8464,6 +8464,11 @@ exports.exec = function(code) {
8464
8464
  return eval(transform(code));
8465
8465
  };
8466
8466
 
8467
+ if (typeof window === "undefined" || window === null) {
8468
+ return;
8469
+ }
8470
+ headEl = document.getElementsByTagName('head')[0];
8471
+
8467
8472
  var run = exports.run = function(code) {
8468
8473
  var jsx = docblock.parseAsObject(docblock.extract(code)).jsx;
8469
8474
 
@@ -8474,10 +8479,6 @@ var run = exports.run = function(code) {
8474
8479
  headEl.appendChild(scriptEl);
8475
8480
  };
8476
8481
 
8477
- if (typeof window === "undefined" || window === null) {
8478
- return;
8479
- }
8480
-
8481
8482
  var load = exports.load = function(url, callback) {
8482
8483
  var xhr;
8483
8484
  xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP')