You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Andy Dufilie <an...@gmail.com> on 2016/01/01 05:15:54 UTC

JS.SWC source (was: Re: Closure compiler CompilationLevel)

On Thu, Dec 31, 2015 at 5:41 PM, Andy Dufilie <an...@gmail.com>
wrote:

> Now that I can compile with js.swc, I am getting a lot of errors because
> the type information for many JS functions is incorrect. For example, it
> says Array's sort() is a void function. Where is the source code for js.swc
> so that I can contribute fixes?
>

>From the mailing list archives I've deduced that js.swc was generated from
the google closure extern files.  That explains why Array.prototype.sort()
and Array.prototype.reverse() were missing return values. I've submitted a
pull request to the google closure project (
https://github.com/google/closure-compiler/pull/1359/files).

Could we incorporate this fix without waiting for the closure-compiler
project to be updated?
Right now, we get this error:

    Implicit coercion of a value of type void to an unrelated type Array.
        var r:Array = [1,2].reverse();

I can see that the "externc.js.swc" build target in flex-falcon/build.xml
generates js.swc and that flex-falcon/externs/js/js-compile-config.xml
specifies which google closure extern files to use, but the
closure-compiler files (es3.js, etc) are not included in the project.  Does
the generation of js.swc involve a manual process of downloading these
files, or are they retrieved in some script?

Another example error related to these extern files is:
    Implicit coercion of a value with static type Object to a possibly
unrelated type int.
        var x:int = [1,2].pop();
...which I've created a flex-falcon pull request for (
https://github.com/apache/flex-falcon/pull/4).

There are other errors I'm getting, for which I can create pull requests or
bug reports.

Re: JS.SWC source (was: Re: Closure compiler CompilationLevel)

Posted by Andy Dufilie <an...@gmail.com>.
On Fri, Jan 1, 2016 at 3:28 AM, Alex Harui <ah...@adobe.com> wrote:

> The externc.createjs.swc target calls another ant script that munges the
> externs.  You could try doing that temporarily for the externc.js.swc
> target.
>
>
Oops, I was looking at the wrong target. I see the externc.js.swc target
now - it compiles, and I am able to test my patches locally. Thanks.

Re: JS.SWC source (was: Re: Closure compiler CompilationLevel)

Posted by Alex Harui <ah...@adobe.com>.

On 12/31/15, 8:15 PM, "Andy Dufilie" <an...@gmail.com> wrote:

>
>
>I can see that the "externc.js.swc" build target in flex-falcon/build.xml
>generates js.swc and that flex-falcon/externs/js/js-compile-config.xml
>specifies which google closure extern files to use, but the
>closure-compiler files (es3.js, etc) are not included in the project.
>Does
>the generation of js.swc involve a manual process of downloading these
>files, or are they retrieved in some script?

The ant scripts download and set up the extern files.

The externc.createjs.swc target calls another ant script that munges the
externs.  You could try doing that temporarily for the externc.js.swc
target.

-Alex