Packageweavejs.util
Classpublic class JS
InheritanceJS Inheritance Object



Public Methods
 MethodDefined By
  
asClass(classDef:*):Class
[static] Implementation of "classDef as Class"
JS
  
[static]
JS
  
clearInterval(id:int):void
[static]
JS
  
clearTimeout(id:int):void
[static]
JS
  
compile(script:String, paramNames:Array = null, errorHandler:Function = null):Function
[static] Compiles a script into a function with optional parameter names.
JS
  
copyObject(object:Object, allowNonPrimitiveRefs:Boolean = false):Object
[static] Makes a deep copy of an object.
JS
  
error(... args):void
[static] Calls console.error()
JS
  
getOwnPropertyNames(object:Object):Array
[static] AS->JS Language helper for Object.getOwnPropertyNames()
JS
  
getPropertyNames(object:Object, useCache:Boolean):Array
[static] Similar to Object.getOwnPropertyNames(), except it also checks prototypes.
JS
  
hasProperty(object:Object, prop:String):Boolean
[static] Similar to Object.hasOwnProperty(), except it also checks prototypes.
JS
  
isClass(classDef:Object):Boolean
[static] Implementation of "classDef is Class"
JS
  
isIterable(value:*):Boolean
[static] Tests if an object can be iterated over.
JS
  
isPrimitive(value:*):Boolean
[static] Tests if a value is of a primitive type.
JS
  
log(... args):void
[static] Calls console.log()
JS
  
mapEntries(map:Object):Array
[static] AS->JS Language helper for getting an Array of Map entries.
JS
  
mapKeys(map:Object):Array
[static] AS->JS Language helper for getting an Array of Map keys.
JS
  
mapValues(map:Object):Array
[static] AS->JS Language helper for getting an Array of Map values.
JS
  
now():Number
[static] Current time in milliseconds
JS
  
objectKeys(object:Object):Array
[static] AS->JS Language helper for Object.keys()
JS
  
requestAnimationFrame(func:Function):int
[static]
JS
  
setInterval(func:Function, delay:int, ... params):int
[static]
JS
  
setTimeout(func:Function, delay:int, ... params):int
[static]
JS
  
toArray(value:*):Array
[static] AS->JS Language helper for converting array-like objects to Arrays Extracts an Array of values from an Iterator object.
JS
Public Constants
 ConstantDefined By
  ArrayBuffer : Class
[static] AS->JS Language helper for ArrayBuffer
JS
  DataView : Class
[static] AS->JS Language helper for DataView
JS
  global : Object
[static] AS->JS Language helper to get the global scope
JS
  Map : Class
[static] AS->JS Language helper for Map
JS
  Promise : Class
[static] AS->JS Language helper for Promise
JS
  Uint8Array : Class
[static] AS->JS Language helper for Uint8Array
JS
  WeakMap : Class
[static] AS->JS Language helper for WeakMap
JS
Method Detail
asClass()method
public static function asClass(classDef:*):Class

Implementation of "classDef as Class"

Parameters

classDef:*

Returns
Class
cancelAnimationFrame()method 
public static function cancelAnimationFrame(id:int):void

Parameters

id:int

clearInterval()method 
public static function clearInterval(id:int):void

Parameters

id:int

clearTimeout()method 
public static function clearTimeout(id:int):void

Parameters

id:int

compile()method 
public static function compile(script:String, paramNames:Array = null, errorHandler:Function = null):Function

Compiles a script into a function with optional parameter names.

Parameters

script:String — A String containing JavaScript code.
 
paramNames:Array (default = null) — A list of parameter names for the generated function, so that these variable names can be used in the script.
 
errorHandler:Function (default = null) — A function that handles errors.

Returns
Function
copyObject()method 
public static function copyObject(object:Object, allowNonPrimitiveRefs:Boolean = false):Object

Makes a deep copy of an object.

Parameters

object:Object — If allowNonPrimitiveRefs is true, references to non-primitive objects will be allowed. If allowNonPrimitiveRefs is false, an error will be thrown if a non-primitive object is found.
 
allowNonPrimitiveRefs:Boolean (default = false)

Returns
Object
error()method 
public static function error(... args):void

Calls console.error()

Parameters

... args

getOwnPropertyNames()method 
public static function getOwnPropertyNames(object:Object):Array

AS->JS Language helper for Object.getOwnPropertyNames()

Parameters

object:Object

Returns
Array
getPropertyNames()method 
public static function getPropertyNames(object:Object, useCache:Boolean):Array

Similar to Object.getOwnPropertyNames(), except it also checks prototypes.

Parameters

object:Object
 
useCache:Boolean

Returns
Array
hasProperty()method 
public static function hasProperty(object:Object, prop:String):Boolean

Similar to Object.hasOwnProperty(), except it also checks prototypes.

Parameters

object:Object
 
prop:String

Returns
Boolean
isClass()method 
public static function isClass(classDef:Object):Boolean

Implementation of "classDef is Class"

Parameters

classDef:Object

Returns
Boolean
isIterable()method 
public static function isIterable(value:*):Boolean

Tests if an object can be iterated over. If this returns true, then toArray() can be called to get all the values from the iterator as an Array.

Parameters

value:*

Returns
Boolean
isPrimitive()method 
public static function isPrimitive(value:*):Boolean

Tests if a value is of a primitive type.

Parameters

value:*

Returns
Boolean
log()method 
public static function log(... args):void

Calls console.log()

Parameters

... args

mapEntries()method 
public static function mapEntries(map:Object):Array

AS->JS Language helper for getting an Array of Map entries.

Parameters

map:Object

Returns
Array
mapKeys()method 
public static function mapKeys(map:Object):Array

AS->JS Language helper for getting an Array of Map keys.

Parameters

map:Object

Returns
Array
mapValues()method 
public static function mapValues(map:Object):Array

AS->JS Language helper for getting an Array of Map values.

Parameters

map:Object

Returns
Array
now()method 
public static function now():Number

Current time in milliseconds

Returns
Number
objectKeys()method 
public static function objectKeys(object:Object):Array

AS->JS Language helper for Object.keys()

Parameters

object:Object

Returns
Array
requestAnimationFrame()method 
public static function requestAnimationFrame(func:Function):int

Parameters

func:Function

Returns
int
setInterval()method 
public static function setInterval(func:Function, delay:int, ... params):int

Parameters

func:Function
 
delay:int
 
... params

Returns
int
setTimeout()method 
public static function setTimeout(func:Function, delay:int, ... params):int

Parameters

func:Function
 
delay:int
 
... params

Returns
int
toArray()method 
public static function toArray(value:*):Array

AS->JS Language helper for converting array-like objects to Arrays Extracts an Array of values from an Iterator object. Converts Arguments object to an Array.

Parameters

value:*

Returns
Array
Constant Detail
ArrayBufferConstant
public static const ArrayBuffer:Class

AS->JS Language helper for ArrayBuffer

DataViewConstant 
public static const DataView:Class

AS->JS Language helper for DataView

globalConstant 
public static const global:Object

AS->JS Language helper to get the global scope

MapConstant 
public static const Map:Class

AS->JS Language helper for Map

PromiseConstant 
public static const Promise:Class

AS->JS Language helper for Promise

Uint8ArrayConstant 
public static const Uint8Array:Class

AS->JS Language helper for Uint8Array

WeakMapConstant 
public static const WeakMap:Class

AS->JS Language helper for WeakMap