Moscrif API Docs for: 2012q3
Show:

Function Class

Library: core

Script Function object.

Item Index

Methods

Methods

this

(
  • [value]
  • functionBody
)

Constructor, compiles the functionBody and creates function object of it. arg1... argN are names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript identifier.

Parameters:

  • [value] Object optional
  • functionBody Function

apply

(
  • thisObj
  • [p0]
  • [argv]
)

Invokes the function in context of this set to thisObj. Parameters of the function call are compsed from list of parameters p0 ... pN and appended by members of argv array. This actual call will have following parameters list: p0, ..., pN, argv[0], ... argv[N].

Parameters:

  • thisObj Object
  • [p0] Object optional multiple
  • [argv] Object optional multiple

call

(
  • thisObj
  • [p0]
)

Invokes the function in context of this set to thisObj.

Parameters:

  • thisObj Object
  • [p0] Object optional multiple

Example:

....onDraw = function(sender, canvas)
{
    var self = this super;
    self.draw.call(self, canvas);
}

exists

(
  • tag
  • [deep=false]
)

Checks property by its tag for existence.

Parameters:

  • tag Symbol

    Symbol of the property

  • [deep=false] Boolean optional

    If deep == true then does deep lookup - in function itself and its chain of classes.

propertyAt

(
  • tag
)

Does lookup in the object for member/property by its tag. This is a direct equivalent of obj.tag construction.

Parameters:

  • tag Symbol

    Symbol of the property

remove

(
  • tag
)

Removes property of the function by its tag (a.k.a. name).

Parameters:

  • tag Symbol

    Symbol of the property

Properties

fullName

String

Fully qualified name of the function, includes name of class or namespace. For anonymous (lambda) functions it is undefined.

length

Integer

Returns total number of declared parameters.

name

String

Name of the function. For anonymous (lambda) functions it is undefined.

optionals

Integer

Returns number of optional parameters.