Add exponentiation operator

This commit is contained in:
Anthony Van de Gejuchte
2016-06-18 00:25:18 +02:00
committed by Richard van Velzen
parent 2246c79318
commit 6eaeb19a4a
6 changed files with 190 additions and 4 deletions

View File

@@ -538,7 +538,13 @@ function OutputStream(options) {
PARENS([ AST_Unary, AST_Undefined ], function(output){
var p = output.parent();
return p instanceof AST_PropAccess && p.expression === this
|| p instanceof AST_New;
|| p instanceof AST_New
|| p instanceof AST_Binary
&& p.operator === "**"
&& this instanceof AST_UnaryPrefix
&& p.left === this
&& this.operator !== "++"
&& this.operator !== "--";
});
PARENS(AST_Seq, function(output){