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 c9457b8  MXMLRoyaleEmitter: use emitter tokens instead of strings for 
the defineProperties call and fix whitespace before first property
c9457b8 is described below

commit c9457b821a478af347704ac989baa6e380dddce2
Author: Josh Tynjala <[email protected]>
AuthorDate: Tue Jan 5 13:09:03 2021 -0800

    MXMLRoyaleEmitter: use emitter tokens instead of strings for the 
defineProperties call and fix whitespace before first property
---
 .../internal/codegen/mxml/royale/MXMLRoyaleEmitter.java  | 16 ++++++++++++++--
 .../test/resources/royale/files/MyInitialView_result.js  |  2 +-
 .../resources/royale/files/RoyaleTest_again_result.js    |  2 +-
 3 files changed, 16 insertions(+), 4 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 ff2fc41..462c3c8 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
@@ -2254,10 +2254,22 @@ public class MXMLRoyaleEmitter extends MXMLEmitter 
implements
 
        String formattedCName = formatQualifiedName(cname);
 
-       write("Object.defineProperties(");
+        write(JSGoogEmitterTokens.OBJECT);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.DEFINE_PROPERTIES);
+        write(ASEmitterTokens.PAREN_OPEN);
        write(formattedCName);
-       writeNewline(".prototype, /** @lends {" + formattedCName + ".prototype} 
*/ {");
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.PROTOTYPE);
+        write(ASEmitterTokens.COMMA);
+        write(ASEmitterTokens.SPACE);
+        write("/** @lends {");
+        write(formattedCName);
+        write(ASEmitterTokens.MEMBER_ACCESS);
+        write(JSEmitterTokens.PROTOTYPE);
+       write("} */ {");
         indentPush();
+        writeNewline();
         int i = 0;
         for (MXMLDescriptorSpecifier instance : instances)
         {
diff --git 
a/compiler-jx/src/test/resources/royale/files/MyInitialView_result.js 
b/compiler-jx/src/test/resources/royale/files/MyInitialView_result.js
index 8efd46d..5afeced 100644
--- a/compiler-jx/src/test/resources/royale/files/MyInitialView_result.js
+++ b/compiler-jx/src/test/resources/royale/files/MyInitialView_result.js
@@ -386,7 +386,7 @@ MyInitialView.prototype.$EH_11_6 = function(event)
 
 
 Object.defineProperties(MyInitialView.prototype, /** @lends 
{MyInitialView.prototype} */ {
-lbl: {
+  lbl: {
     /** @this {MyInitialView} */
     get: function() {
       return this.lbl_;
diff --git 
a/compiler-jx/src/test/resources/royale/files/RoyaleTest_again_result.js 
b/compiler-jx/src/test/resources/royale/files/RoyaleTest_again_result.js
index 9fda5ff..c930caa 100644
--- a/compiler-jx/src/test/resources/royale/files/RoyaleTest_again_result.js
+++ b/compiler-jx/src/test/resources/royale/files/RoyaleTest_again_result.js
@@ -222,7 +222,7 @@ RoyaleTest_again.prototype.$EH_8_0 = function(event)
 
 
 Object.defineProperties(RoyaleTest_again.prototype, /** @lends 
{RoyaleTest_again.prototype} */ {
-service: {
+  service: {
     /** @this {RoyaleTest_again} */
     get: function() {
       return this.service_;

Reply via email to