org.mozilla.javascript

Class NativeFunction

public abstract class NativeFunction extends BaseFunction

This class implements the Function native object. See ECMA 15.3.

Author: Norris Boyd

Method Summary
intgetArity()
DebuggableScriptgetDebuggableView()
StringgetEncodedSource()
Get encoded source string.
protected abstract intgetLanguageVersion()
intgetLength()
protected abstract intgetParamAndVarCount()
Get number of declared parameters and variables defined through var statements.
protected abstract intgetParamCount()
Get number of declared parameters.
protected abstract StringgetParamOrVarName(int index)
Get parameter or variable name.
voidinitScriptFunction(Context cx, Scriptable scope)
StringjsGet_name()

Method Detail

getArity

public int getArity()

getDebuggableView

public DebuggableScript getDebuggableView()

getEncodedSource

public String getEncodedSource()
Get encoded source string.

getLanguageVersion

protected abstract int getLanguageVersion()

getLength

public int getLength()

getParamAndVarCount

protected abstract int getParamAndVarCount()
Get number of declared parameters and variables defined through var statements.

getParamCount

protected abstract int getParamCount()
Get number of declared parameters. It should be 0 for scripts.

getParamOrVarName

protected abstract String getParamOrVarName(int index)
Get parameter or variable name. If index < getParamCount, then return the name of the corresponding parameter. Otherwise returm the name of variable.

initScriptFunction

public final void initScriptFunction(Context cx, Scriptable scope)

jsGet_name

public String jsGet_name()

Deprecated: Use getFunctionName instead. For backwards compatibility keep an old method name used by Batik and possibly others.