Code coverage report for src/repl.js

Statements: 90.48% (19 / 21)      Branches: 56.52% (26 / 46)      Functions: 100% (5 / 5)      Lines: 90.48% (19 / 21)     

All files » src/ » repl.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 451 1   1   1   1   1   1 936   17585 1121 1121   17585     936     1   939     939       1   1       1          
(function() {
  var closer, closerCore, escodegen, estraverse, repl, wireThisAccess, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
 
  closer = (_ref = (_ref1 = (_ref2 = typeof window !== "undefined" && window !== null ? window.closer : void 0) != null ? _ref2 : typeof self !== "undefined" && self !== null ? self.closer : void 0) != null ? _ref1 : typeof global !== "undefined" && global !== null ? global.closer : void 0) != null ? _ref : require('./closer');
 
  closerCore = (_ref3 = (_ref4 = (_ref5 = typeof window !== "undefined" && window !== null ? window.closerCore : void 0) != null ? _ref5 : typeof self !== "undefined" && self !== null ? self.closerCore : void 0) != null ? _ref4 : typeof global !== "undefined" && global !== null ? global.closerCore : void 0) != null ? _ref3 : require('./closer-core');
 
  escodegen = require('escodegen');
 
  estraverse = require('estraverse');
 
  wireThisAccess = function(ast) {
    estraverse.replace(ast, {
      leave: function(node) {
        if (node.type === 'ThisExpression') {
          node.type = 'Identifier';
          node.name = '__$this';
        }
        return node;
      }
    });
    return ast;
  };
 
  repl = {
    parse: function(src, options) {
      return wireThisAccess(closerCore.$wireCallsToCoreFunctions(closer.parse(src, options), 'closerCore', 'closerAssertions'));
    },
    generateJS: function(src, options) {
      return escodegen.generate(repl.parse(src, options));
    }
  };
 
  module.exports = repl;
 
  Iif (typeof self !== "undefined" && self !== null) {
    self.repl = repl;
  }
 
  Iif (typeof window !== "undefined" && window !== null) {
    window.repl = repl;
  }
 
}).call(this);