You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/06/17 04:01:58 UTC
[royale-compiler] branch develop updated: handle missing attributes
This is an automated email from the ASF dual-hosted git repository.
aharui 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 3cfee8b handle missing attributes
3cfee8b is described below
commit 3cfee8b54a5f74ca526a844ab6d8208069d684fb
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Jun 16 20:47:01 2019 -0700
handle missing attributes
---
.../codegen/js/royale/JSRoyaleASDocEmitter.java | 37 ++++++++++++++++------
1 file changed, 28 insertions(+), 9 deletions(-)
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java
index c40332c..e32ac65 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java
@@ -729,15 +729,34 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit
IDeprecationInfo dep = def.getDeprecationInfo();
writeNewline(" \"deprecated\": {");
indentPush();
- write(" \"message\": \"");
- write(dep.getMessage());
- writeNewline("\",");
- write(" \"replacement\": \"");
- write(dep.getReplacement());
- writeNewline("\",");
- write(" \"since\": \"");
- write(dep.getSince());
- writeNewline("\"}");
+ String comma = "";
+ String msg = dep.getMessage();
+ if (msg != null)
+ {
+ write(" \"message\": \"");
+ write(msg);
+ write("\"");
+ comma = ",";
+ }
+ String replace = dep.getReplacement();
+ if (replace != null)
+ {
+ writeNewline(comma);
+ write(" \"replacement\": \"");
+ write(replace);
+ write("\"");
+ comma = ",";
+ }
+ String since = dep.getSince();
+ if (since != null)
+ {
+ writeNewline("\",");
+ write(" \"since\": \"");
+ write(since);
+ write("\"");
+ comma = ",";
+ }
+ writeNewline("}");
}
else
{