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 6fe3caecaa97d010dff89e99dcd62f3fce169028 Author: Josh Tynjala <joshtynj...@apache.org> AuthorDate: Thu Feb 1 13:46:16 2024 -0800 MXMLClassDirectiveProcessor: fix missing handling of compiler.mxml.children-as-data == false that caused WebService and RemoteObject sdk.dependent.tests to fail I think that these tests probably originally passed. Related commits: dee493d017bf187ed9632076bee54a967917deeb 64fe48f14ee880e0463199b84afdd9acb19ced07 --- .../compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java | 6 +++--- compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java | 5 +---- compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java | 3 --- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java index 4b7537210..38304df15 100644 --- a/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java +++ b/compiler/src/main/java/org/apache/royale/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java @@ -1883,7 +1883,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor numProperties += 1; int numOperations = context.getCounter(IL.WEB_SERVICE_OPERATIONS_OR_REMOTE_OBJECT_METHODS); - if (numOperations > 0) + if (numOperations > 0 && getProject().getTargetSettings().getMxmlChildrenAsData()) numProperties += 1; if (newCodeGen && addCounters) context.pushNumericConstant(numProperties); @@ -1894,7 +1894,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor if (context.hasModel) context.transfer(IL.MXML_MODEL_PROPERTIES); context.transfer(IL.PROPERTIES); - if (numOperations > 0) + if (numOperations > 0 && getProject().getTargetSettings().getMxmlChildrenAsData()) { context.addInstruction(OP_pushstring, "operations"); context.addInstruction(OP_pushfalse); @@ -1976,7 +1976,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor // temp.operations = { "op1":operation1, "op2":operation2 }; // to initialize WebService.operations property from a list of <s:operation> tags. final int operationsCount = context.getCounter(IL.WEB_SERVICE_OPERATIONS_OR_REMOTE_OBJECT_METHODS); - if(operationsCount > 0) + if(!getProject().getTargetSettings().getMxmlChildrenAsData() && operationsCount > 0) { context.pushTarget(); context.transfer(IL.WEB_SERVICE_OPERATIONS_OR_REMOTE_OBJECT_METHODS); diff --git a/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java b/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java index 13288822e..d3006b7e8 100644 --- a/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java +++ b/compiler/src/test/java/mxml/tags/MXMLRemoteObjectTagTests.java @@ -19,7 +19,6 @@ package mxml.tags; -import org.junit.Ignore; import org.junit.Test; /** @@ -63,14 +62,13 @@ public class MXMLRemoteObjectTagTests extends MXMLInstanceTagTestsBase compileAndRun(mxml, true, true, false, null); } - @Ignore @Test public void MXMLRemoteObjectTag_method() { String[] declarations = new String[] { "<mx:RemoteObject id='ro1'>", - // " <mx:method name='m1'/>", + " <mx:method name='m1'/>", "</mx:RemoteObject>" }; String[] scriptDeclarations = new String[] @@ -87,7 +85,6 @@ public class MXMLRemoteObjectTagTests extends MXMLInstanceTagTestsBase compileAndRun(mxml, true, true, false, null); } - @Ignore @Test public void MXMLRemoteObjectTag_twoMethods() { diff --git a/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java b/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java index c3e7ff437..da4ffacb3 100644 --- a/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java +++ b/compiler/src/test/java/mxml/tags/MXMLWebServiceTagTests.java @@ -19,7 +19,6 @@ package mxml.tags; -import org.junit.Ignore; import org.junit.Test; /** @@ -85,7 +84,6 @@ public class MXMLWebServiceTagTests extends MXMLInstanceTagTestsBase compileAndRun(mxml, true, true, false, null); } - @Ignore @Test public void MXMLWebServiceTag_operation() { @@ -109,7 +107,6 @@ public class MXMLWebServiceTagTests extends MXMLInstanceTagTestsBase compileAndRun(mxml, true, true, false, null); } - @Ignore @Test public void MXMLWebServiceTag_twoOperations() {