Namespace: reflect

core. reflect

The core.reflect package is a modular JavaScript library that provides extra methods to to obtain information about loaded objects or generate it.

Author:
License:

Methods


invoke(c [, args])

Invokes dynamically a class constructor.

Parameters:
Name Type Argument Description
c function

The constructor (Function or Class) to invoke.

args array <optional>

the array of all arguments to pass to the constructor (max 32).

Returns:

an instance of the class, or null if class can not construct.

Example
var ar = invoke( Array , [1,2,3]) ;trace( dump( ar ) ) ; // 1,2,3

invoke(name [, domain])

Returns the instance of a public definition in a specific domain object.

Parameters:
Name Type Argument Description
name string

The name of the full qualified path of a definition (instance, class, etc).

domain Object <optional>

A global object or namespace who contains the definition object. By default, the function use the global scope object where to find the reference.

Example
var definition = core.reflect.getDefinitionByName('system.signals.Signal') ;trace( definition ) ;