This class implements the Function native object.
See ECMA 15.3.
getEncodedSource
public String getEncodedSource()
Get encoded source string.
getLanguageVersion
protected abstract int getLanguageVersion()
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.
getParamOrVarConst
protected boolean getParamOrVarConst(int index)
Get parameter or variable const-ness.
If
index <32getParamCount()
, then return the const-ness
of the corresponding parameter. Otherwise return whether the variable is
const.
getParamOrVarName
protected abstract String getParamOrVarName(int index)
Get parameter or variable name.
If
index <32getParamCount()
, then return the name of the
corresponding parameter. Otherwise return the name of variable.
int getArity
public @Override int getArity()
int getLength
public @Override int getLength()
jsGet_name
public String jsGet_name()
Use BaseFunction.getFunctionName()
instead.
For backwards compatibility keep an old method name used by
Batik and possibly others.
resumeGenerator
public Object resumeGenerator(Context cx,
Scriptable scope,
int operation,
Object state,
Object value)
Resume execution of a suspended generator.
cx
- The current contextscope
- Scope for the parent generator functionoperation
- The resumption operation (next, send, etc.. )state
- The generator state (has locals, stack, etc.)value
- The return value of yield (if required).
- The next yielded value (if any)