You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2019/09/16 08:07:13 UTC

[royale-compiler] 06/06: ConfigConditionBlockNode: fix fillInOffsets() and normalize() when disabled

This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch release/0.9.6
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 383416e53128c9303f4feac8eea8841351de82e0
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Fri Sep 13 14:59:02 2019 -0700

    ConfigConditionBlockNode: fix fillInOffsets() and normalize() when disabled
    
    They didn't set end/endLine/endColumn before.
    
    (cherry picked from commit b81373b433fdc20477b337e9d729d16646626a17)
---
 .../internal/tree/as/ConfigConditionBlockNode.java   | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java
index 62080ea..c0998f4 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/tree/as/ConfigConditionBlockNode.java
@@ -33,7 +33,7 @@ import org.apache.royale.compiler.tree.ASTNodeID;
  */
 public final class ConfigConditionBlockNode extends BlockNode
 {
-    private final boolean enabled;
+    private boolean enabled;
 
     /**
      * Create a enabled or disabled configuration config block.
@@ -58,6 +58,24 @@ public final class ConfigConditionBlockNode extends BlockNode
         else
             return 0;
     }
+
+    @Override
+    protected void fillInOffsets()
+    {
+        boolean oldEnabled = enabled;
+        enabled = true;
+        super.fillInOffsets();
+        enabled = oldEnabled;
+    }
+
+    @Override
+    public void normalize(boolean fillInOffsets)
+    {
+        boolean oldEnabled = enabled;
+        enabled = true;
+        super.normalize(fillInOffsets);
+        enabled = oldEnabled;
+    }
     
     @Override
     protected boolean buildInnerString(StringBuilder sb)