Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

 

ActionScript

JavaScript + Closure annotation

Notes

int

Code Block
int(value)
Code Block
int(value)

We implement utility method in the global namespace: 


Code Block
function int(value) {
     return value >> 0;
}

trace

Code Block
trace(value)
Code Block
trace(value)

We implement utility method in the global namespace:


Code Block
function trace(value) {
    try {
        if (console && console.log) {
            console.log(value);
        }
    } catch (e) {
        // ignore; at least we tried ;-)
    }
}

uint

Code Block
uint(value)
Code Block
uint(value)

We implement utility method in the global namespace: 


Code Block
function uint(value) {
     return value >>> 0;
}

Vector

Code Block
result = Vector.<type>(valueArray);
Code Block
result = /** @type {Array.<type>} */ valueArray;

Let the Closure Compiler handle (check) what is basically a type cast from general Array to a Typed Array.