Hi Alex,

1.12.2018 10:12 tarihinde Alex Harui yazdı:

Hi Serkan,

You are using a new version of Closure Compiler than Royale so it might be picking up things that the older version we use isn’t.  Royale is using 20170625.  I thought there were more things you had to specify like entry-point.  And Royale is setting some other options as well.  You can check the compiler source in JSClosureCompilerWrapper.java.  But if the newer compiler doesn’t have memory problems maybe we should look into switching to it.


I am going to work on this.

Number of lines in a file shouldn’t matter as much as total file size.  MXML is encoded into an array that spans a lot of lines to make it easier to read, but the lines should be short.  And this is just for debugging. Again, Closure Compiler will optimize all of that and remove lots of whitespace.

Okay

Due to things i mixed in one mail, I think you missed the last question :)

I compiled the test project with royale, not with new version of closure and here is the result :

Dec 01, 2018 8:59:29 AM com.google.javascript.jscomp.LoggerErrorManager println SEVERE: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/main/LogAnalysisForm.js:1531: ERROR - Object literal contains illegal duplicate key "findWhat", disallowed in strict mode
    findWhat: {
    ^^^^^^^^

Discovered that when look into js file it is really declared twice

L:1321
/** @export */
    findWhat: {
    /** @this {main.LogAnalysisForm} */
    get: function() {
      return this.findWhat_;
    },
    /** @this {main.LogAnalysisForm} */
    set: function(value) {
      if (value != this.findWhat_) {
        this.findWhat_ = value;
this.dispatchEvent(org.apache.royale.events.ValueChangeEvent.createUpdateEvent(this, 'findWhat', null, value));
      }
    }
  },

L:1531

/** @export */
    findWhat: {
    /** @this {main.LogAnalysisForm} */
    get: function() {
      return this.findWhat_;
    },
    /** @this {main.LogAnalysisForm} */
    set: function(value) {
      if (value != this.findWhat_) {
        this.findWhat_ = value;
this.dispatchEvent(org.apache.royale.events.ValueChangeEvent.createUpdateEvent(this, 'findWhat', null, value));
      }
    }
  },


The test project, generated js files and full log is available if you require.


Thanks,
Serkan

-Alex

*From: *Serkan Taş <[email protected]>
*Reply-To: *"[email protected]" <[email protected]>
*Date: *Friday, November 30, 2018 at 10:36 PM
*To: *"[email protected]" <[email protected]>
*Subject: *Simple Test Project compiler issues

Hi Alex,

According to documentation of closure  i tried launch the compiler from the command line.

java -jar D:\dev\royale-emulation-works\compiler-latest\closure-compiler-v20181125.jar --js .\PinaraUI_mx_managers_SystemManager.js .\Namespace.js .\QName.js .\XML.js .\XMLList.js .\org\**.js mx\**.js .\com\**.js .\spark\**.js .\library\**.js

From the output of the compiler, i got some weird logs like :

./com/likya/pinara/comps/jobcrud/LogAnalysisForm.js:1292: ERROR - Object literal contains illegal duplicate key "findWhat", disallowed in strict mode
    findWhat: {
    ^^^^^^^^

This error does not appear in my previous compiling and i thought that because of memory overflow may the compiler is not completed even in js-debug folder ?

This forced me to prepare simple test project to what is happening. I prepared the project and compiled and get these output like :

Dec 01, 2018 8:59:29 AM com.google.javascript.jscomp.LoggerErrorManager println SEVERE: D:/dev/royale-emulation-works/github/royale-testing/src/main/bin/js-debug/main/LogAnalysisForm.js:1531: ERROR - Object literal contains illegal duplicate key "findWhat", disallowed in strict mode
    findWhat: {
    ^^^^^^^^

Discovered that when look into js file it is really declared twice

L:1321
  /** @export */
    findWhat: {
    /** @this {main.LogAnalysisForm} */
    get: function() {
      return this.findWhat_;
    },
    /** @this {main.LogAnalysisForm} */
    set: function(value) {
      if (value != this.findWhat_) {
        this.findWhat_ = value;
this.dispatchEvent(org.apache.royale.events.ValueChangeEvent.createUpdateEvent(this, 'findWhat', null, value));
      }
    }
  },

L:1531

/** @export */
    findWhat: {
    /** @this {main.LogAnalysisForm} */
    get: function() {
      return this.findWhat_;
    },
    /** @this {main.LogAnalysisForm} */
    set: function(value) {
      if (value != this.findWhat_) {
        this.findWhat_ = value;
this.dispatchEvent(org.apache.royale.events.ValueChangeEvent.createUpdateEvent(this, 'findWhat', null, value));
      }
    }
  },


May be you may have description of these behavior.

Ant the size of the file LogAnalysisForm.mxml has 310 lines but js version has 2465. I can understand the increase in size while transforming to js but the ratio is nearly 10 times, just to note.

The test project, generated js files and full log is available if you require.


Thanks,
Serkan


Reply via email to