mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
Make power operator compilation use proper AST nodes
This commit is contained in:
@@ -2348,11 +2348,9 @@
|
||||
};
|
||||
|
||||
Op.prototype.compilePower = function(o) {
|
||||
var left, parts, right;
|
||||
left = this.first.compileToFragments(o, LEVEL_OP);
|
||||
right = this.second.compileToFragments(o, LEVEL_OP);
|
||||
parts = [this.makeCode('Math.pow('), left, this.makeCode(', '), right, this.makeCode(')')];
|
||||
return this.joinFragmentArrays(parts, '');
|
||||
var pow;
|
||||
pow = new Value(new Literal('Math'), [new Access(new Literal('pow'))]);
|
||||
return new Call(pow, [this.first, this.second]).compileToFragments(o);
|
||||
};
|
||||
|
||||
Op.prototype.toString = function(idt) {
|
||||
|
||||
Reference in New Issue
Block a user