Package org.mozilla.javascript
Class NativeFunction
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.BaseFunction
org.mozilla.javascript.NativeFunction
- All Implemented Interfaces:
Serializable
,Callable
,ConstProperties
,DebuggableObject
,Function
,IdFunctionCall
,Scriptable
This class implements the Function native object.
See ECMA 15.3.
- See Also:
-
Field Summary
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getArity()
Get encoded source string.int
final void
initScriptFunction
(Context cx, Scriptable scope) Deprecated.resumeGenerator
(Context cx, Scriptable scope, int operation, Object state, Object value) Resume execution of a suspended generator.Methods inherited from class org.mozilla.javascript.BaseFunction
call, construct, createObject, execIdCall, getClassName, getFunctionName, getTypeOf, hasInstance, setImmunePrototypeProperty
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, defineOwnProperty, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, put, setAttributes
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasProperty, hasProperty, isConst, isEmpty, isExtensible, isSealed, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype
-
Constructor Details
-
NativeFunction
public NativeFunction()
-
-
Method Details
-
initScriptFunction
-
getLength
public int getLength()- Overrides:
getLength
in classBaseFunction
-
getArity
public int getArity()- Overrides:
getArity
in classBaseFunction
-
jsGet_name
Deprecated.UseBaseFunction.getFunctionName()
instead. For backwards compatibility keep an old method name used by Batik and possibly others. -
getEncodedSource
Get encoded source string. -
getDebuggableView
-
resumeGenerator
public Object resumeGenerator(Context cx, Scriptable scope, int operation, Object state, Object value) Resume execution of a suspended generator.- Parameters:
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).- Returns:
- The next yielded value (if any)
-
BaseFunction.getFunctionName()
instead.