On 9/19/16, 12:09 AM, "lizhi" <s...@qq.com> wrote:

>and my code not the same as createjs.
>my code is baseon "flash api",so need remove-circulars.

IMO, if your code is a library that is eventually compiled into an
application via MXMLC, then you only need -remove-circulars when MXMLC is
run.  That's because the remove-circulars needs to understand the
dependency order.  For example if you have:

Class A
{
  Var foo:B;
}

Class B
{
  Var bar:A;
}

That is a circularity, but you can't remove the goog.requires("B") from
A.js, nor can you remove the goog.requires("A") from B.js until you
compile these into an app.  Otherwise you would remove both and then B
wouldn't load or A wouldn't load depending on which one got loaded first.
Now if you are concatenating all files, you should be able to remove all
goog.requires as long as you have concatenated in static dependency order.
 But otherwise, MXMLC will see that your customer's app used A directly as
in:

Class Main
{
  Var a:A;
}

And then -remove-circulars will remove the goog.requires("A") from B.js
since it knows that main.js will have a goog.requires("A").

-Alex

Reply via email to