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

Compare with Current View Page History

« Previous Version 12 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

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="77621b78-4d29-45e7-a951-f609c641c19b"><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="1267faeb-6309-478b-a3be-0ecb9f7cf5f1"><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

 

 

 

 

  • No labels