A table showing how each ActionScript language 'feature' is should be translated to Google Closure Tools assisted JavaScript by the FalconJS Compiler.
Using these AS3 references:
- Global Constants, Functions and Classes
- Statements, Keywords and Directives
Using Google Closure annotations:
- Annotating JavaScript for the Closure Compiler
Table quick navigation:
- coming soon ;-)
|
Test Available In FlexJS (+/-)? |
ActionScript |
JavaScript + Closure annotation |
Notes |
||
---|---|---|---|---|---|---|
Global Constants |
|
|
|
|
||
Infinity |
- |
Infinity |
Infinity |
|
||
-Infinity |
- |
-Infinity |
-Infinity |
|
||
NaN |
- |
NaN |
NaN |
|
||
undefined |
- |
undefined |
undefined |
|
||
|
|
|
|
|
||
Global Functions |
|
|
|
|
||
Array() |
- |
Array |
Array |
|
||
Boolean() |
- |
Boolean |
Boolean |
|
||
decodeURI() |
- |
decodeURI |
decodeURI |
|
||
decodeURIComponent() |
- |
decodeURIComponent |
decodeURIComponent |
|
||
encodeURI() |
- |
encodeURI |
encodeURI |
|
||
encodeURIComponent() |
- |
encodeURIComponent |
encodeURIComponent |
|
||
escape() |
|
|
|
|
||
int() |
|
|
|
|
||
isFinite() |
|
|
|
|
||
isNaN() |
|
|
|
|
||
isXMLName() |
|
|
|
|
||
Number() |
|
|
|
|
||
Object() |
|
|
|
|
||
parseFloat() |
|
|
|
|
||
parseInt() |
|
|
|
|
||
String() |
|
|
|
|
||
trace() |
|
|
|
|
||
uint() |
|
|
|
|
||
unescape() |
|
|
|
|
||
Vector() |
|
|
|
|
||
XML() |
|
|
|
|
||
XMLList() |
|
|
|
|
||
|
|
|
|
|
||
Classes |
|
|
|
|
||
ArgumentError |
|
|
|
|
||
arguments |
|
|
|
|
||
Array |
|
|
|
|
||
Boolean |
|
|
|
|
||
Class |
|
package com.example.components { public class MyClass { public function MyClass() {} } } |
goog.provide('com.example.components.MyClass'); /** * @constructor */ com.example.components.MyClass = function() {}; |
|
||
Date |
|
|
|
|
||
DefinitionError |
|
|
|
|
||
Error |
|
|
|
|
||
EvalError |
|
|
|
|
||
Function |
|
|
|
|
||
int |
|
|
|
|
||
JSON |
|
|
|
|
||
Math |
|
|
|
|
||
Namespace |
|
|
|
|
||
Number |
|
|
|
|
||
Object |
|
|
|
|
||
QName |
|
|
|
|
||
RangeError |
|
|
|
|
||
ReferenceError |
|
|
|
|
||
RegExp |
|
|
|
|
||
SecurityError |
|
|
|
|
||
String |
|
|
|
|
||
SyntaxError |
|
|
|
|
||
TypeError |
|
|
|
|
||
uint |
|
|
|
|
||
URIError |
|
|
|
|
||
Vector |
|
|
|
|
||
VerifyError |
|
|
|
|
||
XML |
|
|
|
|
||
XMLList |
|
|
|
|
||
|
|
|
|
|
||
Arithmetic |
|
|
|
|
||
+ |
|
|
|
|
||
-- |
|
|
|
|
||
/ |
|
|
|
|
||
++ |
|
|
|
|
||
% |
|
|
|
|
||
* |
|
|
|
|
||
- |
|
|
|
|
||
|
|
|
|
|
||
Arithmetic compound assignment |
|
|
|
|
||
+= |
|
|
|
|
||
/= |
|
|
|
|
||
%= |
|
|
|
|
||
*= |
|
|
|
|
||
-= |
|
|
|
|
||
|
|
|
|
|
||
Assignment |
|
|
|
|
||
= |
|
|
|
|
||
|
|
|
|
|
||
Bitwise |
|
|
|
|
||
& |
|
|
|
|
||
<< |
|
|
|
|
||
~ |
|
|
|
|
||
| |
|
|
|
|
||
>> |
|
|
|
|
||
>>> |
|
|
|
|
||
^ |
|
|
|
|
||
|
|
|
|
|
||
Bitwise compound assignment |
|
|
|
|
||
&= |
|
|
|
|
||
<<= |
|
|
|
|
||
|= |
|
|
|
|
||
>>= |
|
|
|
|
||
>>>= |
|
|
|
|
||
^= |
|
|
|
|
||
|
|
|
|
|
||
Comment |
|
|
|
|
||
/../ |
|
|
|
|
||
// |
|
|
|
|
||
|
|
|
|
|
||
Comparison |
|
|
|
|
||
== |
|
|
|
|
||
> |
|
|
|
|
||
>= |
|
|
|
|
||
!= |
|
|
|
|
||
< |
|
|
|
|
||
<= |
|
|
|
|
||
=== |
|
|
|
|
||
!== |
|
|
|
|
||
|
|
|
|
|
||
Logical |
|
|
|
|
||
&& |
|
|
|
|
||
&&= |
|
|
|
|
||
! |
|
|
|
|
||
|| |
|
|
|
|
||
||= |
|
|
|
|
||
|
|
|
|
|
||
Other |
|
|
|
|
||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="18ee86ee-d21c-42f6-9133-39da5491511f"><ac:plain-text-body><![CDATA[ |
[] |
|
|
|
|
]]></ac:plain-text-body></ac:structured-macro> |
as |
|
|
|
|
||
, |
|
|
|
|
||
?: |
|
|
|
|
||
delete |
|
|
|
|
||
. |
|
|
|
|
||
in |
|
|
|
|
||
instanceof |
|
|
|
|
||
is |
|
|
|
|
||
:: |
|
|
|
|
||
new |
|
|
|
|
||
{} |
|
|
|
|
||
() |
|
|
|
|
||
/ |
|
|
|
|
||
: |
|
|
|
|
||
typeof |
|
|
|
|
||
void |
|
|
|
|
||
|
|
|
|
|
||
String |
|
|
|
|
||
+ |
|
|
|
|
||
+= |
|
|
|
|
||
" |
|
|
|
|
||
|
|
|
|
|
||
XML |
|
|
|
|
||
@ |
|
|
|
|
||
{} |
|
|
|
|
||
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e84d813e-ba16-49f0-a8d1-a2205726b469"><ac:plain-text-body><![CDATA[ |
[] |
|
|
|
|
]]></ac:plain-text-body></ac:structured-macro> |
+ |
|
|
|
|
||
+= |
|
|
|
|
||
delete |
|
|
|
|
||
.. |
|
|
|
|
||
. |
|
|
|
|
||
() |
|
|
|
|
||
<> |
|
|
|
|
||
|
|
|
|
|
||
Statements |
|
|
|
|
||
break |
|
|
|
|
||
case |
|
|
|
|
||
continue |
|
|
|
|
||
default |
|
|
|
|
||
do...while |
|
|
|
|
||
else |
|
|
|
|
||
for |
|
|
|
|
||
for...in |
|
|
|
|
||
for each...in |
|
|
|
|
||
if |
|
|
|
|
||
label |
|
|
|
|
||
return |
|
|
|
|
||
super |
|
|
|
|
||
switch |
|
|
|
|
||
throw |
|
|
|
|
||
try...catch...finally |
|
|
|
|
||
while |
|
|
|
|
||
with |
|
|
|
|
||
|
|
|
|
|
||
Attribute Keywords |
|
|
|
|
||
dynamic |
|
|
|
|
||
final |
|
|
|
|
||
internal |
|
|
|
|
||
native |
|
|
|
|
||
override |
|
|
|
|
||
private |
|
|
|
|
||
protected |
|
|
|
|
||
public |
|
|
|
|
||
static |
|
|
|
|
||
|
|
|
|
|
||
Definition keywords |
|
|
|
|
||
... (rest) parameter |
|
|
|
|
||
class |
|
|
|
|
||
const |
|
|
|
|
||
extends |
|
|
|
|
||
function |
|
|
|
|
||
get |
|
|
|
|
||
implements |
|
|
|
|
||
interface |
|
|
|
|
||
namespace |
|
|
|
|
||
package |
|
|
|
|
||
set |
|
|
|
|
||
var |
|
|
|
|
||
|
|
|
|
|
||
Directives |
|
|
|
|
||
default xml namespace |
|
|
|
|
||
import |
|
|
|
|
||
include |
|
|
|
|
||
use namespace |
|
|
|
|
||
|
|
|
|
|
||
Namespaces |
|
|
|
|
||
AS3 |
|
|
|
|
||
flash_proxy |
|
|
|
|
||
object_proxy |
|
|
|
|
||
|
|
|
|
|
||
Primary expression keywords |
|
|
|
|
||
false |
|
|
|
|
||
null |
|
|
|
|
||
this |
|
|
|
|
||
true |
|
|
|
|
||
|
|
|
|
|
||
OLD |
|
|
|
|
||
Inheriting |
|
package com.example.components{ import org.apache.flex.Button; public class MyClass extends Button { public function MyClass() { super(); } } } |
goog.provide('com.example.components.MyClass'); goog.require('org.apache.flex.Button'); /** * @constructor * @extends {org.apache.flex.Button} */ com.example.components.MyClass = function() { goog.base(this); }; goog.inherits(com.example.components.MyClass, org.apache.flex.Button); |
|
||
Implementing |
|
TBD |
TBD |
|
||
Inheriting + Implementing |
|
TBD |
TBD |
|
||
|
|
|
|
|
||
Fields |
|
|
|
|
||
private |
|
private var _myVar:String = ""; |
Inside the constructor function: /** * @private * @type {string} */ this._myVar = ''; |
|
||
protected |
|
This is how far I got today ;-) |
|
|
||
public |
|
|
|
|
||
Global Constants |
|
|
|
|