UNPKG

@philpl/buble

Version:

The blazing fast, batteries-included ES2015 compiler

13 lines (11 loc) 365 B
import Node from '../Node.js'; export default class BinaryExpression extends Node { transpile(code, transforms) { if (this.operator === '**' && transforms.exponentiation) { code.prependRight(this.start, `Math.pow( `); code.overwrite(this.left.end, this.right.start, `, `); code.appendLeft(this.end, ` )`); } super.transpile(code, transforms); } }