All files / helpers eval-node-path.js

83.33% Statements 10/12
66.67% Branches 4/6
100% Functions 2/2
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  1x 1x 1x             2x 2x 2x 1x 1x   1x     8x  
function evalDeopt(deopt) {
  Iif (!deopt.isMemberExpression()) return;
  const uid = deopt.node.object.name;
  console.log(
    uid,
    deopt.scope.getProgramParent().globals
  )
}
 
function evaluateNodePath(path, prevDeopt) {
  const { value, confident, deopt } = path.evaluate();
  Iif (confident) return value;
  if (deopt !== prevDeopt) {
    evalDeopt(deopt);
    return evaluateNodePath(path, deopt);
  }
  throw deopt.buildCodeFrameError('Could not evaluate value');
}
 
module.exports = evaluateNodePath;