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

Compare with Current View Page History

« Previous Version 10 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="ef4ac872-cc1f-47fc-81b2-36aeb24e96b5"><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="96783030-2f22-42c1-ac31-95260dcf3663"><ac:plain-text-body><![CDATA[

[]

 

 

 

 

]]></ac:plain-text-body></ac:structured-macro>

+

 

 

 

 

+=

 

 

 

 

delete

 

 

 

 

..

 

 

 

 

.

 

 

 

 

()

 

 

 

 

<>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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