Code coverage report for 6to5/transformation/transformers/es7-exponentiation-operator.js

Statements: 100% (11 / 11)      Branches: 100% (4 / 4)      Functions: 100% (2 / 2)      Lines: 100% (9 / 9)      Ignored: none     

All files » 6to5/transformation/transformers/ » es7-exponentiation-operator.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17    1 1   1 265 1 1     1 203   1    
// https://github.com/rwaldron/exponentiation-operator
 
var t = require("../../types");
var pow = t.memberExpression(t.identifier("Math"), t.identifier("pow"));
 
exports.AssignmentExpression = function (node) {
  if (node.operator !== "**=") return;
  node.operator = "=";
  node.right = t.callExpression(pow, [node.left, node.right]);
};
 
exports.BinaryExpression = function (node) {
  if (node.operator !== "**") return;
 
  return t.callExpression(pow, [node.left, node.right]);
};