Package org.mozilla.javascript
Class ScriptRuntime
java.lang.Object
org.mozilla.javascript.ScriptRuntime
- Direct Known Subclasses:
OptRuntime
This is the class that implements the runtime.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis is an interface defining a message provider. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<?> static final Class<?> static final Class<?> static final Class<?> static final Class<?> static final Class<?> static final Class<?> static final Class<?> static final Object[]static final String[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Class<?> static final Class<?> static final Class<?> static final Class<?> static final doublestatic final Doublestatic final doublestatic final Class<?> static final Class<?> static Localestatic final Class<Scriptable> static final Class<?> static final Class<?> static final Class<?> -
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequenceadd(CharSequence val1, Object val2) static CharSequenceadd(Object val1, CharSequence val2) static Objectstatic voidaddInstructionCount(Context cx, int instructionsToAdd) static ObjectapplyOrCall(boolean isApply, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) Function.prototype.apply and Function.prototype.call See Ecma 15.3.4.[34]static Scriptablebind(Context cx, Scriptable scope, String id) Returns the object in the scope chain that has a given property.static ObjectDeprecated.The method is only present for compatibility.static RefcallRef(Callable function, Scriptable thisObj, Object[] args, Context cx) Perform function call in reference context.static ObjectcallSpecial(Context cx, Callable fun, Scriptable thisObj, Object[] args, Scriptable scope, Scriptable callerThis, int callType, String filename, int lineNumber) static RegExpProxystatic booleanstatic booleanstatic EcmaErrorconstructError(String error, String message) static EcmaErrorconstructError(String error, String message, int lineNumberDelta) static EcmaErrorconstructError(String error, String message, String sourceName, int lineNumber, String lineSource, int columnNumber) static ScriptablecreateFunctionActivation(NativeFunction funObj, Scriptable scope, Object[] args) static ObjectDeprecated.static ObjectDeprecated.static Objectdelete(Object obj, Object id, Context cx, Scriptable scope, boolean isName) The delete operator See ECMA 11.4.1 In ECMA 0.19, the description of the delete operator (11.4.1) assumes that the [[Delete]] method returns a value.static booleandeleteObjectElem(Scriptable target, Object elem, Context cx) static ObjectdoTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) static ObjectelemIncrDecr(Object obj, Object index, Context cx, int incrDecrMask) Deprecated.static ObjectelemIncrDecr(Object obj, Object index, Context cx, Scriptable scope, int incrDecrMask) static voidenterActivationFunction(Context cx, Scriptable scope) static ScriptableenterDotQuery(Object value, Scriptable scope) static ScriptableenterWith(Object obj, Context cx, Scriptable scope) static Objectstatic ObjectDeprecated.UseenumInit(Object, Context, Scriptable, int)insteadstatic ObjectDeprecated.UseenumInit(Object, Context, Scriptable, int)insteadstatic ObjectenumInit(Object value, Context cx, Scriptable scope, int enumType) static Booleanstatic Objectstatic booleanEquality See ECMA 11.9static StringescapeAttributeValue(Object value, Context cx) Escapes the reserved characters in a value of an attributestatic Stringstatic StringescapeString(String s, char escapeQuote) For escaping strings printed by object and array literals; not quite the same as 'escape.'static StringescapeTextValue(Object value, Context cx) Escapes the reserved characters in a value of a text nodestatic ObjectevalSpecial(Context cx, Scriptable scope, Object thisArg, Object[] args, String filename, int lineNumber) The eval function property of the global object.static voidstatic Object[]getArrayElements(Scriptable object) static CallablegetElemFunctionAndThis(Object obj, Object elem, Context cx) Deprecated.static CallablegetElemFunctionAndThis(Object obj, Object elem, Context cx, Scriptable scope) Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj.static ScriptableObjectstatic ScriptableObjectgetLibraryScopeOrNull(Scriptable scope) static StringgetMessage(String messageId, Object[] arguments) static StringgetMessage0(String messageId) static StringgetMessage1(String messageId, Object arg1) static StringgetMessage2(String messageId, Object arg1, Object arg2) static StringgetMessage3(String messageId, Object arg1, Object arg2, Object arg3) static Stringstatic CallablegetNameFunctionAndThis(String name, Context cx, Scriptable scope) Prepare for calling name(...): return function corresponding to name and make current top scope available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj.static ObjectgetObjectElem(Object obj, Object elem, Context cx) Deprecated.static ObjectgetObjectElem(Object obj, Object elem, Context cx, Scriptable scope) Call obj.[[Get]](id)static ObjectgetObjectElem(Scriptable obj, Object elem, Context cx) static ObjectgetObjectIndex(Object obj, double dblIndex, Context cx) Deprecated.static ObjectgetObjectIndex(Object obj, double dblIndex, Context cx, Scriptable scope) A cheaper and less general version of the above for well-known argument types.static ObjectgetObjectIndex(Scriptable obj, int index, Context cx) static ObjectgetObjectProp(Object obj, String property, Context cx) Deprecated.static ObjectgetObjectProp(Object obj, String property, Context cx, Scriptable scope) Version of getObjectElem when elem is a valid JS identifier name.static ObjectgetObjectProp(Scriptable obj, String property, Context cx) static ObjectgetObjectPropNoWarn(Object obj, String property, Context cx) Deprecated.static ObjectgetObjectPropNoWarn(Object obj, String property, Context cx, Scriptable scope) static CallablegetPropFunctionAndThis(Object obj, String property, Context cx) Deprecated.static CallablegetPropFunctionAndThis(Object obj, String property, Context cx, Scriptable scope) Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj.static RegExpProxystatic Scriptablestatic ObjectgetTopLevelProp(Scriptable scope, String id) static CallablegetValueFunctionAndThis(Object value, Context cx) Prepare for calling(...): return function corresponding to and make parent scope of the function available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. static booleanhasObjectElem(Scriptable target, Object elem, Context cx) static booleanhasTopCall(Context cx) static booleanThe in operator.static longindexFromString(String str) Return -1L if str is not an index, or the index value as lower 32 bits of the result.static voidinitFunction(Context cx, Scriptable scope, NativeFunction function, int type, boolean fromEvalCode) static ScriptableObjectinitSafeStandardObjects(Context cx, ScriptableObject scope, boolean sealed) static voidinitScript(NativeFunction funObj, Scriptable thisObj, Context cx, Scriptable scope, boolean evalScript) static ScriptableObjectinitStandardObjects(Context cx, ScriptableObject scope, boolean sealed) static booleaninstanceOf(Object a, Object b, Context cx) The instanceof operator.static booleanisArrayObject(Object obj) static booleanisJSLineTerminator(int c) static booleanstatic booleanisPrimitive(Object obj) static booleanisRhinoRuntimeType(Class<?> cl) static booleanjsDelegatesTo(Scriptable lhs, Scriptable rhs) Delegates tostatic Scriptablestatic longstatic ScriptableleaveDotQuery(Scriptable scope) static ScriptableleaveWith(Scriptable scope) static Refstatic Refstatic Objectname(Context cx, Scriptable scope, String name) Looks up a name in the scope chain and returns its value.static ObjectnameIncrDecr(Scriptable scopeChain, String id, int incrDecrMask) Deprecated.UsenameIncrDecr(Scriptable, String, Context, int)insteadstatic ObjectnameIncrDecr(Scriptable scopeChain, String id, Context cx, int incrDecrMask) static RefnameRef(Object namespace, Object name, Context cx, Scriptable scope, int memberTypeFlags) static RefnameRef(Object name, Context cx, Scriptable scope, int memberTypeFlags) static ScriptablenewArrayLiteral(Object[] objects, int[] skipIndices, Context cx, Scriptable scope) static ScriptablenewBuiltinObject(Context cx, Scriptable scope, TopLevel.Builtins type, Object[] args) static ScriptablenewCatchScope(Throwable t, Scriptable lastCatchScope, String exceptionName, Context cx, Scriptable scope) static ScriptablenewObject(Object fun, Context cx, Scriptable scope, Object[] args) Operator new.static ScriptablenewObject(Context cx, Scriptable scope, String constructorName, Object[] args) static ScriptablenewObjectLiteral(Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, Scriptable scope) static ScriptablenewObjectLiteral(Object[] propertyIds, Object[] propertyValues, Context cx, Scriptable scope) Deprecated.static ObjectnewSpecial(Context cx, Object fun, Object[] args, Scriptable scope, int callType) static RuntimeExceptionnotFoundError(Scriptable object, String property) static RuntimeExceptionnotFunctionError(Object value) static RuntimeExceptionnotFunctionError(Object value, Object messageHelper) static RuntimeExceptionnotFunctionError(Object obj, Object value, String propertyName) static StringnumberToString(double d, int base) static Object[]padArguments(Object[] args, int count) Helper function for builtin objects that use the varargs form.static ObjectpropIncrDecr(Object obj, String id, Context cx, int incrDecrMask) Deprecated.static ObjectpropIncrDecr(Object obj, String id, Context cx, Scriptable scope, int incrDecrMask) static EcmaErrorrangeError(String message) static Objectstatic Objectstatic ObjectrefIncrDecr(Ref ref, Context cx, int incrDecrMask) Deprecated.UserefIncrDecr(Ref, Context, Scriptable, int)insteadstatic ObjectrefIncrDecr(Ref ref, Context cx, Scriptable scope, int incrDecrMask) static ObjectDeprecated.UserefSet(Ref, Object, Context, Scriptable)insteadstatic ObjectrefSet(Ref ref, Object value, Context cx, Scriptable scope) static ScriptablerequireObjectCoercible(Scriptable val, IdFunctionObject idFuncObj) static Objectstatic voidsetBuiltinProtoAndParent(ScriptableObject object, Scriptable scope, TopLevel.Builtins type) static ObjectsetConst(Scriptable bound, Object value, Context cx, String id) static ObjectsetDefaultNamespace(Object namespace, Context cx) static voidsetEnumNumbers(Object enumObj, boolean enumNumbers) static voidsetFunctionProtoAndParent(BaseFunction fn, Scriptable scope) static ObjectsetName(Scriptable bound, Object value, Context cx, Scriptable scope, String id) static ObjectsetObjectElem(Object obj, Object elem, Object value, Context cx) Deprecated.static ObjectsetObjectElem(Object obj, Object elem, Object value, Context cx, Scriptable scope) Call obj.[[Put]](id, value)static ObjectsetObjectElem(Scriptable obj, Object elem, Object value, Context cx) static ObjectsetObjectIndex(Object obj, double dblIndex, Object value, Context cx) Deprecated.static ObjectsetObjectIndex(Object obj, double dblIndex, Object value, Context cx, Scriptable scope) A cheaper and less general version of the above for well-known argument types.static ObjectsetObjectIndex(Scriptable obj, int index, Object value, Context cx) static ObjectsetObjectProp(Object obj, String property, Object value, Context cx) Deprecated.static ObjectsetObjectProp(Object obj, String property, Object value, Context cx, Scriptable scope) Version of setObjectElem when elem is a valid JS identifier name.static ObjectsetObjectProp(Scriptable obj, String property, Object value, Context cx) static voidsetObjectProtoAndParent(ScriptableObject object, Scriptable scope) static voidsetRegExpProxy(Context cx, RegExpProxy proxy) static booleanstatic RefspecialRef(Object obj, String specialProperty, Context cx) Deprecated.UsespecialRef(Object, String, Context, Scriptable)insteadstatic RefspecialRef(Object obj, String specialProperty, Context cx, Scriptable scope) static voidstoreUint32Result(Context cx, long value) static ObjectstrictSetName(Scriptable bound, Object value, Context cx, Scriptable scope, String id) static longtestUint32String(String str) If str is a decimal presentation of Uint32 value, return it as long.static JavaScriptExceptionthrowCustomError(Context cx, Scriptable scope, String constructorName, String message) Equivalent to executing "new $constructorName(message, sourceFileName, sourceLineNo)" from JavaScript.static JavaScriptExceptionthrowError(Context cx, Scriptable scope, String message) Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript.static booleanConvert the value to a boolean.static CharSequencetoCharSequence(Object val) static inttoInt32(double d) static intSee ECMA 9.5.static intstatic doubletoInteger(double d) static doubleSee ECMA 9.4.static doublestatic ScriptabletoIterator(Context cx, Scriptable scope, Scriptable obj, boolean keyOnly) static doubleConvert the value to a number.static doublestatic doubleToNumber applied to the String type See ECMA 9.3.1static ScriptabletoObject(Context cx, Scriptable scope, Object val) Convert the value to an object.static ScriptabletoObject(Context cx, Scriptable scope, Object val, Class<?> staticClass) Deprecated.UsetoObject(Context, Scriptable, Object)instead.static ScriptabletoObject(Scriptable scope, Object val) static ScriptabletoObject(Scriptable scope, Object val, Class<?> staticClass) Deprecated.UsetoObject(Scriptable, Object)instead.static ScriptabletoObjectOrNull(Context cx, Object obj) Deprecated.UsetoObjectOrNull(Context, Object, Scriptable)insteadstatic ScriptabletoObjectOrNull(Context cx, Object obj, Scriptable scope) static ObjecttoPrimitive(Object val) static ObjecttoPrimitive(Object val, Class<?> typeHint) static StringtoString(double val) Optimized version of toString(Object) for numbers.static StringConvert the value to a string.static Stringstatic charSee ECMA 9.7.static longtoUint32(double d) See ECMA 9.6.static longstatic EcmaErrorstatic EcmaErrortypeError0(String messageId) static EcmaErrortypeError1(String messageId, Object arg1) static EcmaErrortypeError2(String messageId, Object arg1, Object arg2) static EcmaErrortypeError3(String messageId, String arg1, String arg2, String arg3) static BaseFunctionDeprecated.static BaseFunctionReturns representation of the [[ThrowTypeError]] object.static StringThe typeof operatorstatic StringtypeofName(Scriptable scope, String id) The typeof operator that correctly handles the undefined casestatic RuntimeExceptionundefCallError(Object object, Object id) static RuntimeExceptionundefReadError(Object object, Object id) static RuntimeExceptionundefWriteError(Object object, Object id, Object value) static ObjectupdateDotQuery(boolean value, Scriptable scope) static BooleanwrapBoolean(boolean b) static ScriptablewrapException(Throwable t, Scriptable scope, Context cx) static IntegerwrapInt(int i) static NumberwrapNumber(double x) static ScriptablewrapRegExp(Context cx, Scriptable scope, Object compiled)
-
Field Details
-
BooleanClass
-
ByteClass
-
CharacterClass
-
ClassClass
-
DoubleClass
-
FloatClass
-
IntegerClass
-
LongClass
-
NumberClass
-
ObjectClass
-
ShortClass
-
StringClass
-
DateClass
-
ContextClass
-
ContextFactoryClass
-
FunctionClass
-
ScriptableObjectClass
-
ScriptableClass
-
ROOT_LOCALE
-
NaN
public static final double NaN -
negativeZero
public static final double negativeZero -
NaNobj
-
ENUMERATE_KEYS
public static final int ENUMERATE_KEYS- See Also:
-
ENUMERATE_VALUES
public static final int ENUMERATE_VALUES- See Also:
-
ENUMERATE_ARRAY
public static final int ENUMERATE_ARRAY- See Also:
-
ENUMERATE_KEYS_NO_ITERATOR
public static final int ENUMERATE_KEYS_NO_ITERATOR- See Also:
-
ENUMERATE_VALUES_NO_ITERATOR
public static final int ENUMERATE_VALUES_NO_ITERATOR- See Also:
-
ENUMERATE_ARRAY_NO_ITERATOR
public static final int ENUMERATE_ARRAY_NO_ITERATOR- See Also:
-
messageProvider
-
emptyArgs
-
emptyStrings
-
-
Method Details
-
typeErrorThrower
Deprecated.Returns representation of the [[ThrowTypeError]] object. See ECMA 5 spec, 13.2.3 -
typeErrorThrower
Returns representation of the [[ThrowTypeError]] object. See ECMA 5 spec, 13.2.3 -
isRhinoRuntimeType
-
initSafeStandardObjects
public static ScriptableObject initSafeStandardObjects(Context cx, ScriptableObject scope, boolean sealed) -
initStandardObjects
public static ScriptableObject initStandardObjects(Context cx, ScriptableObject scope, boolean sealed) -
getLibraryScopeOrNull
-
isJSLineTerminator
public static boolean isJSLineTerminator(int c) -
isJSWhitespaceOrLineTerminator
public static boolean isJSWhitespaceOrLineTerminator(int c) -
wrapBoolean
-
wrapInt
-
wrapNumber
-
toBoolean
Convert the value to a boolean. See ECMA 9.2. -
toNumber
Convert the value to a number. See ECMA 9.3. -
toNumber
-
toNumber
ToNumber applied to the String type See ECMA 9.3.1 -
padArguments
Helper function for builtin objects that use the varargs form. ECMA function formal arguments are undefined if not supplied; this function pads the argument array out to the expected length, if necessary. -
escapeString
-
escapeString
For escaping strings printed by object and array literals; not quite the same as 'escape.' -
toCharSequence
-
toString
Convert the value to a string. See ECMA 9.8. -
toString
-
toString
Optimized version of toString(Object) for numbers. -
numberToString
-
toObject
-
toObjectOrNull
Deprecated.UsetoObjectOrNull(Context, Object, Scriptable)insteadWarning: This doesn't allow to resolve primitive prototype properly when many top scopes are involved -
toObjectOrNull
- Parameters:
scope- the scope that should be used to resolve primitive prototype
-
toObject
Deprecated.UsetoObject(Scriptable, Object)instead. -
toObject
Convert the value to an object. See ECMA 9.9. -
toObject
@Deprecated public static Scriptable toObject(Context cx, Scriptable scope, Object val, Class<?> staticClass) Deprecated.UsetoObject(Context, Scriptable, Object)instead. -
call
@Deprecated public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) Deprecated.The method is only present for compatibility. -
newObject
public static Scriptable newObject(Context cx, Scriptable scope, String constructorName, Object[] args) -
newBuiltinObject
public static Scriptable newBuiltinObject(Context cx, Scriptable scope, TopLevel.Builtins type, Object[] args) -
toInteger
See ECMA 9.4. -
toInteger
public static double toInteger(double d) -
toInteger
-
toInt32
See ECMA 9.5. -
toInt32
-
toInt32
public static int toInt32(double d) -
toUint32
public static long toUint32(double d) See ECMA 9.6.- Returns:
- long value representing 32 bits unsigned integer
-
toUint32
-
toUint16
See ECMA 9.7. -
setDefaultNamespace
-
searchDefaultNamespace
-
getTopLevelProp
-
indexFromString
Return -1L if str is not an index, or the index value as lower 32 bits of the result. Note that the result needs to be cast to an int in order to produce the actual index, which may be negative. -
testUint32String
If str is a decimal presentation of Uint32 value, return it as long. Othewise return -1L; -
getObjectElem
Deprecated.Call obj.[[Get]](id) -
getObjectElem
Call obj.[[Get]](id) -
getObjectElem
-
getObjectProp
Deprecated.Version of getObjectElem when elem is a valid JS identifier name. -
getObjectProp
Version of getObjectElem when elem is a valid JS identifier name.- Parameters:
scope- the scope that should be used to resolve primitive prototype
-
getObjectProp
-
getObjectPropNoWarn
Deprecated. -
getObjectPropNoWarn
-
getObjectIndex
Deprecated.A cheaper and less general version of the above for well-known argument types. -
getObjectIndex
A cheaper and less general version of the above for well-known argument types. -
getObjectIndex
-
setObjectElem
Deprecated.Call obj.[[Put]](id, value) -
setObjectElem
public static Object setObjectElem(Object obj, Object elem, Object value, Context cx, Scriptable scope) Call obj.[[Put]](id, value) -
setObjectElem
-
setObjectProp
@Deprecated public static Object setObjectProp(Object obj, String property, Object value, Context cx) Deprecated.Version of setObjectElem when elem is a valid JS identifier name. -
setObjectProp
public static Object setObjectProp(Object obj, String property, Object value, Context cx, Scriptable scope) Version of setObjectElem when elem is a valid JS identifier name. -
setObjectProp
-
setObjectIndex
@Deprecated public static Object setObjectIndex(Object obj, double dblIndex, Object value, Context cx) Deprecated.A cheaper and less general version of the above for well-known argument types. -
setObjectIndex
public static Object setObjectIndex(Object obj, double dblIndex, Object value, Context cx, Scriptable scope) A cheaper and less general version of the above for well-known argument types. -
setObjectIndex
-
deleteObjectElem
-
hasObjectElem
-
refGet
-
refSet
Deprecated.UserefSet(Ref, Object, Context, Scriptable)instead -
refSet
-
refDel
-
specialRef
Deprecated.UsespecialRef(Object, String, Context, Scriptable)instead -
specialRef
-
delete
Deprecated. -
delete
Deprecated.The delete operator See ECMA 11.4.1 In ECMA 0.19, the description of the delete operator (11.4.1) assumes that the [[Delete]] method returns a value. However, the definition of the [[Delete]] operator (8.6.2.5) does not define a return value. Here we assume that the [[Delete]] method doesn't return a value. -
delete
The delete operator See ECMA 11.4.1 In ECMA 0.19, the description of the delete operator (11.4.1) assumes that the [[Delete]] method returns a value. However, the definition of the [[Delete]] operator (8.6.2.5) does not define a return value. Here we assume that the [[Delete]] method doesn't return a value. -
name
Looks up a name in the scope chain and returns its value. -
bind
Returns the object in the scope chain that has a given property. The order of evaluation of an assignment expression involves evaluating the lhs to a reference, evaluating the rhs, and then modifying the reference with the rhs value. This method is used to 'bind' the given name to an object containing that property so that the side effects of evaluating the rhs do not affect which property is modified. Typically used in conjunction with setName. See ECMA 10.1.4 -
setName
public static Object setName(Scriptable bound, Object value, Context cx, Scriptable scope, String id) -
strictSetName
public static Object strictSetName(Scriptable bound, Object value, Context cx, Scriptable scope, String id) -
setConst
-
toIterator
-
enumInit
Deprecated.UseenumInit(Object, Context, Scriptable, int)insteadFor backwards compatibility with generated class files -
enumInit
Deprecated.UseenumInit(Object, Context, Scriptable, int)instead -
enumInit
-
setEnumNumbers
-
enumNext
-
enumId
-
enumValue
-
getNameFunctionAndThis
Prepare for calling name(...): return function corresponding to name and make current top scope available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getElemFunctionAndThis
Deprecated.Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getElemFunctionAndThis
public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx, Scriptable scope) Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getPropFunctionAndThis
Deprecated.Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. Warning: this doesn't allow to resolve primitive prototype properly when many top scopes are involved. -
getPropFunctionAndThis
public static Callable getPropFunctionAndThis(Object obj, String property, Context cx, Scriptable scope) Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getValueFunctionAndThis
Prepare for calling(...): return function corresponding to and make parent scope of the function available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
callRef
Perform function call in reference context. Should always return value that can be passed torefGet(Ref, Context)orrefSet(Ref, Object, Context)arbitrary number of times. The args array reference should not be stored in any object that is can be GC-reachable after this method returns. If this is necessary, store args.clone(), not args array itself. -
newObject
Operator new. See ECMA 11.2.2 -
callSpecial
public static Object callSpecial(Context cx, Callable fun, Scriptable thisObj, Object[] args, Scriptable scope, Scriptable callerThis, int callType, String filename, int lineNumber) -
newSpecial
public static Object newSpecial(Context cx, Object fun, Object[] args, Scriptable scope, int callType) -
applyOrCall
public static Object applyOrCall(boolean isApply, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) Function.prototype.apply and Function.prototype.call See Ecma 15.3.4.[34] -
evalSpecial
public static Object evalSpecial(Context cx, Scriptable scope, Object thisArg, Object[] args, String filename, int lineNumber) The eval function property of the global object. See ECMA 15.1.2.1 -
typeof
The typeof operator -
typeofName
The typeof operator that correctly handles the undefined case -
add
-
add
-
add
-
nameIncrDecr
Deprecated.UsenameIncrDecr(Scriptable, String, Context, int)insteadThe method is only present for compatibility. -
nameIncrDecr
-
propIncrDecr
Deprecated. -
propIncrDecr
public static Object propIncrDecr(Object obj, String id, Context cx, Scriptable scope, int incrDecrMask) -
elemIncrDecr
@Deprecated public static Object elemIncrDecr(Object obj, Object index, Context cx, int incrDecrMask) Deprecated. -
elemIncrDecr
public static Object elemIncrDecr(Object obj, Object index, Context cx, Scriptable scope, int incrDecrMask) -
refIncrDecr
Deprecated.UserefIncrDecr(Ref, Context, Scriptable, int)instead -
refIncrDecr
-
toPrimitive
-
toPrimitive
-
eq
Equality See ECMA 11.9 -
isPrimitive
-
shallowEq
-
instanceOf
The instanceof operator.- Returns:
- a instanceof b
-
jsDelegatesTo
Delegates to- Returns:
- true iff rhs appears in lhs' proto chain
-
in
The in operator. This is a new JS 1.3 language feature. The in operator mirrors the operation of the for .. in construct, and tests whether the rhs has the property given by the lhs. It is different from the for .. in construct in that:
- it doesn't perform ToObject on the right hand side
- it returns true for DontEnum properties.- Parameters:
a- the left hand operandb- the right hand operand- Returns:
- true if property name or element number a is a property of b
-
cmp_LT
-
cmp_LE
-
getGlobal
-
hasTopCall
-
getTopCallScope
-
doTopCall
public static Object doTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) -
addInstructionCount
-
initScript
public static void initScript(NativeFunction funObj, Scriptable thisObj, Context cx, Scriptable scope, boolean evalScript) -
createFunctionActivation
public static Scriptable createFunctionActivation(NativeFunction funObj, Scriptable scope, Object[] args) -
enterActivationFunction
-
exitActivationFunction
-
newCatchScope
public static Scriptable newCatchScope(Throwable t, Scriptable lastCatchScope, String exceptionName, Context cx, Scriptable scope) -
wrapException
-
enterWith
-
leaveWith
-
enterDotQuery
-
updateDotQuery
-
leaveDotQuery
-
setFunctionProtoAndParent
-
setObjectProtoAndParent
-
setBuiltinProtoAndParent
public static void setBuiltinProtoAndParent(ScriptableObject object, Scriptable scope, TopLevel.Builtins type) -
initFunction
public static void initFunction(Context cx, Scriptable scope, NativeFunction function, int type, boolean fromEvalCode) -
newArrayLiteral
public static Scriptable newArrayLiteral(Object[] objects, int[] skipIndices, Context cx, Scriptable scope) -
newObjectLiteral
@Deprecated public static Scriptable newObjectLiteral(Object[] propertyIds, Object[] propertyValues, Context cx, Scriptable scope) Deprecated.This method is here for backward compat with existing compiled code. It is called when an object literal is compiled. The next instance will be the version called from new code. This method only present for compatibility. -
newObjectLiteral
public static Scriptable newObjectLiteral(Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, Scriptable scope) -
isArrayObject
-
getArrayElements
-
getMessage0
-
getMessage1
-
getMessage2
-
getMessage3
-
getMessage4
-
getMessage
-
constructError
-
constructError
-
constructError
-
rangeError
-
typeError
-
typeError0
-
typeError1
-
typeError2
-
typeError3
-
undefReadError
-
undefCallError
-
undefWriteError
-
notFoundError
-
notFunctionError
-
notFunctionError
-
notFunctionError
-
getRegExpProxy
-
setRegExpProxy
-
checkRegExpProxy
-
wrapRegExp
-
escapeAttributeValue
Escapes the reserved characters in a value of an attribute- Parameters:
value- Unescaped text- Returns:
- The escaped text
-
escapeTextValue
Escapes the reserved characters in a value of a text node- Parameters:
value- Unescaped text- Returns:
- The escaped text
-
memberRef
-
memberRef
-
nameRef
-
nameRef
public static Ref nameRef(Object namespace, Object name, Context cx, Scriptable scope, int memberTypeFlags) -
storeUint32Result
-
lastUint32Result
-
lastStoredScriptable
-
throwError
Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript.- Parameters:
cx- the current contextscope- the current scopemessage- the message- Returns:
- a JavaScriptException you should throw
-
throwCustomError
public static JavaScriptException throwCustomError(Context cx, Scriptable scope, String constructorName, String message) Equivalent to executing "new $constructorName(message, sourceFileName, sourceLineNo)" from JavaScript.- Parameters:
cx- the current contextscope- the current scopemessage- the message- Returns:
- a JavaScriptException you should throw
-
requireObjectCoercible
-