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,Constructable,DebuggableObject,Function,IdFunctionCall,Scriptable,SymbolScriptable
This class implements the Function native object. See ECMA 15.3.
- Author:
- Norris Boyd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator -
Field Summary
Fields inherited from class org.mozilla.javascript.BaseFunction
Id_arguments, Id_arity, Id_length, Id_name, Id_prototype, MAX_INSTANCE_IDFields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetArity()protected abstract intintprotected abstract intGet number of declared parameters and variables defined through var statements.protected abstract intGet number of declared parameters.protected booleangetParamOrVarConst(int index) Get parameter or variable const-ness.protected abstract StringgetParamOrVarName(int index) Get parameter or variable name.Get raw source string.final voidinitScriptFunction(Context cx, Scriptable scope) final voidinitScriptFunction(Context cx, Scriptable scope, boolean es6GeneratorFunction) 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, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getClassName, getClassPrototype, getFunctionName, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getPrototypeProperty, getTypeOf, hasDefaultParameters, hasInstance, hasPrototypeProperty, initPrototypeId, isGeneratorFunction, setImmunePrototypeProperty, setInstanceIdAttributes, setInstanceIdValue, setPrototypeProperty, setPrototypePropertyAttributes, setStandardPropertyAttributes, setupDefaultPrototypeMethods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, ensureType, exportAsJSClass, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributesMethods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
initScriptFunction
-
getLength
public int getLength()- Overrides:
getLengthin classBaseFunction
-
getArity
public int getArity()- Overrides:
getArityin classBaseFunction
-
jsGet_name
Deprecated.UseBaseFunction.getFunctionName()instead. For backwards compatibility keep an old method name used by Batik and possibly others. -
getRawSource
Get raw 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)
-
getLanguageVersion
protected abstract int getLanguageVersion() -
getParamCount
protected abstract int getParamCount()Get number of declared parameters. It should be 0 for scripts. -
getParamAndVarCount
protected abstract int getParamAndVarCount()Get number of declared parameters and variables defined through var statements. -
getParamOrVarName
Get parameter or variable name. Ifindex <, then return the name of the corresponding parameter. Otherwise return the name of variable.getParamCount() -
getParamOrVarConst
protected boolean getParamOrVarConst(int index) Get parameter or variable const-ness. Ifindex <, then return the const-ness of the corresponding parameter. Otherwise return whether the variable is const.getParamCount()
-
BaseFunction.getFunctionName()instead.