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 2b6b669 Avoid outputting declarations if an MXMLDescriptorSpecifier
doesn't actually have an id (explicit or 'effective'). This avoids declarations
that would be made for 'null_' which serve no purpose in any case.
2b6b669 is described below
commit 2b6b66989684d6ceee8f054f9250c5d5b7ef015f
Author: greg-dove <[email protected]>
AuthorDate: Sat May 23 08:38:54 2020 +1200
Avoid outputting declarations if an MXMLDescriptorSpecifier doesn't
actually have an id (explicit or 'effective').
This avoids declarations that would be made for 'null_' which serve no
purpose in any case.
---
.../codegen/mxml/royale/MXMLRoyaleEmitter.java | 25 ++++++++++++----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
index 859823a..02b2f40 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/mxml/royale/MXMLRoyaleEmitter.java
@@ -1464,17 +1464,20 @@ public class MXMLRoyaleEmitter extends MXMLEmitter
implements
{
for (MXMLDescriptorSpecifier instance : instances)
{
- writeNewline();
- writeNewline("/**");
- writeNewline(" * @private");
- writeNewline(" * @type {" + instance.name + "}");
- writeNewline(" */");
- write(ASEmitterTokens.THIS);
- write(ASEmitterTokens.MEMBER_ACCESS);
- String id = instance.id != null ? instance.id :
instance.effectiveId;
- if (!id.startsWith(MXMLRoyaleEmitterTokens.ID_PREFIX.getToken()))
id += "_";
- write(id);
- writeNewline(ASEmitterTokens.SEMICOLON);
+ String id = instance.id != null ? instance.id :
instance.effectiveId;
+ if (id != null) { //it seems id can be null, for
example with a generated Object for Operations via RemoteObject
+ writeNewline();
+ writeNewline("/**");
+ writeNewline(" * @private");
+ writeNewline(" * @type {" + instance.name +
"}");
+ writeNewline(" */");
+ write(ASEmitterTokens.THIS);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+
+ if
(!id.startsWith(MXMLRoyaleEmitterTokens.ID_PREFIX.getToken())) id += "_";
+ write(id);
+ writeNewline(ASEmitterTokens.SEMICOLON);
+ }
}
}