This is an automated email from the ASF dual-hosted git repository.
gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push:
new 893abf4 Quick fix for enclosing parentheses around instanceof
operator. Closes #209
893abf4 is described below
commit 893abf47f62de202eeff002ef847571e1f5b0da8
Author: greg-dove <[email protected]>
AuthorDate: Tue Feb 1 13:34:46 2022 +1300
Quick fix for enclosing parentheses around instanceof operator. Closes #209
---
.../compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
index 051f3ff..d82d17b 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
@@ -81,6 +81,9 @@ public class BinaryOperatorEmitter extends JSSubEmitter
implements
}
else if (id == ASTNodeID.Op_InstanceOfID)
{
+ if (ASNodeUtils.hasParenOpen(node)) {
+ write(ASEmitterTokens.PAREN_OPEN);
+ }
getWalker().walk(node.getLeftOperandNode());
startMapping(node, node.getLeftOperandNode());
@@ -128,6 +131,9 @@ public class BinaryOperatorEmitter extends JSSubEmitter
implements
{
getWalker().walk(node.getRightOperandNode());
}
+ if (ASNodeUtils.hasParenClose(node)) {
+ write(ASEmitterTokens.PAREN_CLOSE);
+ }
}
else
{