You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

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

- Operators

- 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

 

 

 

 

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

 

 

 

 

 

 

 

 

 

Operators

 

 

 

 

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="6d7d8716-0efb-49cd-adf4-04f32663cc4d"><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="3ec34e8b-a9ad-4de7-a2ed-31d972c2b17f"><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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

 

 

  • No labels