Files
babel/packages/babel-plugin-transform-exponentiation-operator/src/index.js
2017-11-06 11:32:47 -08:00

18 lines
397 B
JavaScript

import build from "@babel/helper-builder-binary-assignment-operator-visitor";
import { types as t } from "@babel/core";
export default function() {
return {
visitor: build({
operator: "**",
build(left, right) {
return t.callExpression(
t.memberExpression(t.identifier("Math"), t.identifier("pow")),
[left, right],
);
},
}),
};
}