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
The following commit(s) were added to refs/heads/develop by this push:
new 319f57ba7 JSCSSCompilationSession: output null instead of nothing for
PropertyReference() and Embed() functions
319f57ba7 is described below
commit 319f57ba7951d45379a6db4fcf85d838da9949f1
Author: Josh Tynjala <[email protected]>
AuthorDate: Fri Jun 5 14:53:41 2026 -0700
JSCSSCompilationSession: output null instead of nothing for
PropertyReference() and Embed() functions
This ensures that the JS syntax is valid.
Also, use constants instead of strings to compare with ClassReference,
PropertyReference, and Embed
---
.../internal/driver/js/royale/JSCSSCompilationSession.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
index 611dd0c3a..d177290a0 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/driver/js/royale/JSCSSCompilationSession.java
@@ -604,7 +604,7 @@ public class JSCSSCompilationSession extends
CSSCompilationSession
else if (value instanceof CSSFunctionCallPropertyValue)
{
final CSSFunctionCallPropertyValue functionCall =
(CSSFunctionCallPropertyValue)value;
- if ("ClassReference".equals(functionCall.name))
+ if
(CSSFunctionCallPropertyValue.CLASS_REFERENCE.equals(functionCall.name))
{
final String className =
CSSFunctionCallPropertyValue.getSingleArgumentFromRaw(functionCall.rawArguments);
if ("null".equals(className))
@@ -623,9 +623,10 @@ public class JSCSSCompilationSession extends
CSSCompilationSession
final String urlString =
CSSFunctionCallPropertyValue.getSingleArgumentFromRaw(functionCall.rawArguments);
line.append("\"" + urlString + "\"");
}
- else if ("PropertyReference".equals(functionCall.name))
+ else if
(CSSFunctionCallPropertyValue.PROPERTY_REFERENCE.equals(functionCall.name))
{
// TODO: implement me
+ line.append("null");
}
else if ("calc".equals(functionCall.name))
{
@@ -637,14 +638,10 @@ public class JSCSSCompilationSession extends
CSSCompilationSession
// TODO: implement me
line.append("null");
}
- else if ("Embed".equals(functionCall.name))
+ else if
(CSSFunctionCallPropertyValue.EMBED.equals(functionCall.name))
{
// TODO: implement me
- /*
- final ICompilerProblem e = new CSSCodeGenProblem(
- new IllegalStateException("Unable to find
compilation unit for " + functionCall));
- problems.add(e);
- */
+ line.append("null");
}
else if (otherCSSFunctions.contains(functionCall.name))
{