开发者

Inlining functions in AS3

I'm looking for a way to inline functions in AS3.

I know that the language itself doesn't offer a native way of doing that but perhaps there is another option:

Basically, anything that could eventually be integrated with ANT and run on a Hudson CI server.


You can use Joa Ebert Apparat tools to achieve such a thing and more. You can't inline whatever function you want they are some restrictions

Basically you have to create a new class that extends Macro or Inlined following your need, and declare static function within it, then after running TDSI your function will be inlined.

Check out for example Math inlined function or Macro function


Adobe introduced native inline functions with the new ASC2 compiler in 2012. Use the -inline compiler argument to inline all getters and setters and any functions marked with the new [Inline] metadata. Inlined functions must meet these conditions:

  • The function is final, static or the containing scope is file or package
  • The function does not contain any activations
  • The function does not contain any try or with statements
  • The function does not contain any function closures
  • The function body contains less than 50 expressions

http://www.bytearray.org/?p=4789

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜