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

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

commit 7728ae48326479b1f8a132a8823cda5a6081da08
Author: Josh Tynjala <[email protected]>
AuthorDate: Tue Sep 17 14:26:48 2024 -0700

    ConstantLogic: fix missing warnings for boolean constant comparison with 
undefined
---
 .../compiler/internal/as/codegen/ConstantLogic.jbg | 80 ++++++++++++++++++++++
 1 file changed, 80 insertions(+)

diff --git 
a/compiler/src/main/jburg/org/apache/royale/compiler/internal/as/codegen/ConstantLogic.jbg
 
b/compiler/src/main/jburg/org/apache/royale/compiler/internal/as/codegen/ConstantLogic.jbg
index 02126269f..fbaec8fc9 100644
--- 
a/compiler/src/main/jburg/org/apache/royale/compiler/internal/as/codegen/ConstantLogic.jbg
+++ 
b/compiler/src/main/jburg/org/apache/royale/compiler/internal/as/codegen/ConstantLogic.jbg
@@ -93,6 +93,26 @@
      return ECMASupport.equals(l, r);
  }
 
+ boolean_constant=
+ Op_EqualID(boolean_constant l, constant_value r) : 0
+ {
+    if (r == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return ECMASupport.equals(l, r);
+ }
+
+ boolean_constant=
+ Op_EqualID(constant_value l, boolean_constant r) : 0
+ {
+    if (l == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return ECMASupport.equals(l, r);
+ }
+
  boolean_constant=
  Op_EqualID(numeric_constant l, constant_value r) : 0
  {
@@ -150,6 +170,26 @@
      return ECMASupport.equals(l, r);
  }
 
+ boolean_constant=
+ Op_StrictEqualID(boolean_constant l, constant_value r) : 0
+ {
+    if (r == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return ECMASupport.strictEquals(l, r);
+ }
+
+ boolean_constant=
+ Op_StrictEqualID(constant_value l, boolean_constant r) : 0
+ {
+    if (l == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return ECMASupport.strictEquals(l, r);
+ }
+
  boolean_constant=
  Op_StrictEqualID(numeric_constant l, constant_value r) : 0
  {
@@ -204,6 +244,26 @@
      return !ECMASupport.equals(l, r);
  }
 
+ boolean_constant=
+ Op_NotEqualID(boolean_constant l, constant_value r) : 0
+ {
+    if (r == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return !ECMASupport.equals(l, r);
+ }
+
+ boolean_constant=
+ Op_NotEqualID(constant_value l, boolean_constant r) : 0
+ {
+    if (l == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return !ECMASupport.equals(l, r);
+ }
+
  boolean_constant=
  Op_NotEqualID(numeric_constant l, constant_value r) : 0
  {
@@ -260,6 +320,26 @@
      return !ECMASupport.equals(l, r);
  }
 
+ boolean_constant=
+ Op_StrictNotEqualID(boolean_constant l, constant_value r) : 0
+ {
+    if (r == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return !ECMASupport.strictEquals(l, r);
+ }
+
+ boolean_constant=
+ Op_StrictNotEqualID(constant_value l, boolean_constant r) : 0
+ {
+    if (l == UNDEFINED_VALUE)
+    {
+        recordError(new IllogicalComparisonWithUndefinedProblem(__p));
+    }
+     return !ECMASupport.strictEquals(l, r);
+ }
+
  boolean_constant=
  Op_StrictNotEqualID(numeric_constant l, constant_value r) : 0
  {

Reply via email to