BVB Source Codes

reactide Show loose.js Source code

Return Download reactide: download loose.js Source code - Download reactide Source code - Type:.js
  1. "use strict";
  2.  
  3. exports.__esModule = true;
  4.  
  5. var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
  6.  
  7. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  8.  
  9. var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
  10.  
  11. var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
  12.  
  13. var _inherits2 = require("babel-runtime/helpers/inherits");
  14.  
  15. var _inherits3 = _interopRequireDefault(_inherits2);
  16.  
  17. var _babelHelperFunctionName = require("babel-helper-function-name");
  18.  
  19. var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName);
  20.  
  21. var _vanilla = require("./vanilla");
  22.  
  23. var _vanilla2 = _interopRequireDefault(_vanilla);
  24.  
  25. var _babelTypes = require("babel-types");
  26.  
  27. var t = _interopRequireWildcard(_babelTypes);
  28.  
  29. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  30.  
  31. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  32.  
  33. var LooseClassTransformer = function (_VanillaTransformer) {
  34.   (0, _inherits3.default)(LooseClassTransformer, _VanillaTransformer);
  35.  
  36.   function LooseClassTransformer() {
  37.     (0, _classCallCheck3.default)(this, LooseClassTransformer);
  38.  
  39.     var _this = (0, _possibleConstructorReturn3.default)(this, _VanillaTransformer.apply(this, arguments));
  40.  
  41.     _this.isLoose = true;
  42.     return _this;
  43.   }
  44.  
  45.   LooseClassTransformer.prototype._processMethod = function _processMethod(node, scope) {
  46.     if (!node.decorators) {
  47.  
  48.       var classRef = this.classRef;
  49.       if (!node.static) classRef = t.memberExpression(classRef, t.identifier("prototype"));
  50.       var methodName = t.memberExpression(classRef, node.key, node.computed || t.isLiteral(node.key));
  51.  
  52.       var func = t.functionExpression(null, node.params, node.body, node.generator, node.async);
  53.       func.returnType = node.returnType;
  54.       var key = t.toComputedKey(node, node.key);
  55.       if (t.isStringLiteral(key)) {
  56.         func = (0, _babelHelperFunctionName2.default)({
  57.           node: func,
  58.           id: key,
  59.           scope: scope
  60.         });
  61.       }
  62.  
  63.       var expr = t.expressionStatement(t.assignmentExpression("=", methodName, func));
  64.       t.inheritsComments(expr, node);
  65.       this.body.push(expr);
  66.       return true;
  67.     }
  68.   };
  69.  
  70.   return LooseClassTransformer;
  71. }(_vanilla2.default);
  72.  
  73. exports.default = LooseClassTransformer;
  74. module.exports = exports["default"];
downloadloose.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top