Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.mozilla.javascript.ScriptRuntime
public class ScriptRuntime
extends java.lang.Object
Field Summary | |
static Class | |
static Class | |
static Class | |
static Class | |
static Class | |
static Class | |
static Class | |
static Class | |
static int | |
static int | |
static int | |
static int | |
static int | |
static int | |
static Class | |
static Class | |
static Class | |
static Class | |
static double | |
static Double | |
static Class | |
static Class | |
static Class | |
static Class | |
static Class | |
static Class | |
static Object[] | |
static String[] | |
static double |
Constructor Summary | |
|
Method Summary | |
static Object | |
static String |
|
static String |
|
static void |
|
static Object |
|
static Scriptable |
|
static Object |
|
static Ref |
|
static Object |
|
static RegExpProxy | |
static boolean |
|
static boolean |
|
static EcmaError |
|
static EcmaError |
|
static EcmaError |
|
static Scriptable |
|
static Object | |
static boolean |
|
static Object |
|
static Object |
|
static void |
|
static Scriptable |
|
static Scriptable |
|
static Object | |
static Object | |
static Object | |
static Boolean |
|
static Object | |
static boolean |
|
static String |
|
static String |
|
static String |
|
static String |
|
static Object |
|
static void | |
static Object[] |
|
static Callable |
|
static ScriptableObject | |
static ScriptableObject |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static Callable |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Callable |
|
static RegExpProxy | |
static Scriptable | |
static Object |
|
static Callable |
|
static boolean |
|
static boolean |
|
static boolean | |
static void |
|
static void |
|
static ScriptableObject |
|
static boolean |
|
static boolean |
|
static boolean |
|
static boolean |
|
static boolean |
|
static Scriptable | |
static long | |
static Scriptable |
|
static Scriptable |
|
static Ref | |
static Ref | |
static Object |
|
static Object |
|
static Object |
|
static Ref |
|
static Ref |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static Object |
|
static RuntimeException |
|
static RuntimeException |
|
static RuntimeException |
|
static RuntimeException |
|
static String |
|
static Object[] |
|
static Object |
|
static Object | |
static Object | |
static Object |
|
static Object | |
static Object | |
static Object |
|
static Object |
|
static void |
|
static void |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static Object |
|
static void |
|
static void |
|
static boolean |
|
static Ref |
|
static void |
|
static long |
|
static boolean |
|
static int |
|
static int |
|
static int |
|
static double |
|
static double |
|
static double |
|
static Scriptable |
|
static double |
|
static double |
|
static double |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static Scriptable |
|
static String |
|
static String |
|
static String |
|
static char |
|
static long |
|
static long |
|
static EcmaError |
|
static EcmaError |
|
static EcmaError |
|
static EcmaError |
|
static EcmaError |
|
static String |
|
static String |
|
static RuntimeException |
|
static RuntimeException |
|
static RuntimeException |
|
static Object |
|
static Boolean |
|
static Integer |
|
static Number |
|
public static final Class BooleanClass
public static final Class ByteClass
public static final Class CharacterClass
public static final Class ClassClass
public static final Class ContextClass
public static final Class ContextFactoryClass
public static final Class DateClass
public static final Class DoubleClass
public static final int ENUMERATE_ARRAY
- Field Value:
- 2
public static final int ENUMERATE_ARRAY_NO_ITERATOR
- Field Value:
- 5
public static final int ENUMERATE_KEYS
- Field Value:
- 0
public static final int ENUMERATE_KEYS_NO_ITERATOR
- Field Value:
- 3
public static final int ENUMERATE_VALUES
- Field Value:
- 1
public static final int ENUMERATE_VALUES_NO_ITERATOR
- Field Value:
- 4
public static final Class FloatClass
public static final Class FunctionClass
public static final Class IntegerClass
public static final Class LongClass
public static final double NaN
public static final Double NaNobj
public static final Class NumberClass
public static final Class ObjectClass
public static final Class ScriptableClass
public static final Class ScriptableObjectClass
public static final Class ShortClass
public static final Class StringClass
public static final Object[] emptyArgs
public static final String[] emptyStrings
public static final double negativeZero
public static String add(Object val1, String val2)
public static String add(String val1, Object val2)
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]
public static Scriptable bind(Context cx, Scriptable scope, String id)
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
public static Object call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope)
Deprecated. The method is only present for compatibility.
public static Ref callRef(Callable function, Scriptable thisObj, Object[] args, Context cx)
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.
public static Object callSpecial(Context cx, Callable fun, Scriptable thisObj, Object[] args, Scriptable scope, Scriptable callerThis, int callType, String filename, int lineNumber)
public static boolean cmp_LE(Object val1, Object val2)
public static boolean cmp_LT(Object val1, Object val2)
public static EcmaError constructError(String error, String message, String sourceName, int lineNumber, String lineSource, int columnNumber)
public static EcmaError constructError(String error, String message, int lineNumberDelta)
public static Scriptable createFunctionActivation(NativeFunction funObj, Scriptable scope, Object[] args)
public static Object delete(Object obj, Object id, Context cx)
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.
public static Object doTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
public static Object elemIncrDecr(Object obj, Object index, Context cx, int incrDecrMask)
public static Boolean enumNext(Object enumObj)
public static boolean eq(Object x, Object y)
Equality See ECMA 11.9
public static String escapeAttributeValue(Object value, Context cx)
Escapes the reserved characters in a value of an attribute
- Parameters:
value
- Unescaped text
- Returns:
- The escaped text
public static String escapeString(String s)
public static String escapeString(String s, char escapeQuote)
For escaping strings printed by object and array literals; not quite the same as 'escape.'
public static String escapeTextValue(Object value, Context cx)
Escapes the reserved characters in a value of a text node
- Parameters:
value
- Unescaped text
- Returns:
- The escaped text
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
public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx)
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.
public static String getMessage(String messageId, Object[] arguments)
public static String getMessage0(String messageId)
public static String getMessage1(String messageId, Object arg1)
public static String getMessage2(String messageId, Object arg1, Object arg2)
public static String getMessage3(String messageId, Object arg1, Object arg2, Object arg3)
public static String getMessage4(String messageId, Object arg1, Object arg2, Object arg3, Object arg4)
public static Callable getNameFunctionAndThis(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. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method.
public static Object getObjectElem(Object obj, Object elem, Context cx)
Call obj.[[Get]](id)
public static Object getObjectProp(Object obj, String property, Context cx)
Version of getObjectElem when elem is a valid JS identifier name.
public static Object getObjectPropNoWarn(Object obj, String property, Context cx)
public static Callable getPropFunctionAndThis(Object obj, String property, Context cx)
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.
public static Callable getValueFunctionAndThis(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. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method.
public static boolean in(Object a, Object b, Context cx)
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
public static void initFunction(Context cx, Scriptable scope, NativeFunction function, int type, boolean fromEvalCode)
public static void initScript(NativeFunction funObj, Scriptable thisObj, Context cx, Scriptable scope, boolean evalScript)
public static ScriptableObject initStandardObjects(Context cx, ScriptableObject scope, boolean sealed)
public static boolean instanceOf(Object a, Object b, Context cx)
The instanceof operator.
- Returns:
- a instanceof b
public static boolean isArrayObject(Object obj)
public static boolean isJSLineTerminator(int c)
public static boolean isRhinoRuntimeType(Class cl)
public static boolean jsDelegatesTo(Scriptable lhs, Scriptable rhs)
Delegates to
- Returns:
- true iff rhs appears in lhs' proto chain
public static Ref memberRef(Object obj, Object namespace, Object elem, Context cx, int memberTypeFlags)
public static Object name(Context cx, Scriptable scope, String name)
Looks up a name in the scope chain and returns its value.
public static Object nameIncrDecr(Scriptable scopeChain, String id, int incrDecrMask)
Deprecated. The method is only present for compatibility.
public static Object nameIncrDecr(Scriptable scopeChain, String id, Context cx, int incrDecrMask)
public static Ref nameRef(Object namespace, Object name, Context cx, Scriptable scope, int memberTypeFlags)
public static Scriptable newArrayLiteral(Object[] objects, int[] skipIndices, Context cx, Scriptable scope)
public static Scriptable newCatchScope(Throwable t, Scriptable lastCatchScope, String exceptionName, Context cx, Scriptable scope)
public static Scriptable newObject(Object fun, Context cx, Scriptable scope, Object[] args)
Operator new. See ECMA 11.2.2
public static Scriptable newObject(Context cx, Scriptable scope, String constructorName, Object[] args)
public static Scriptable newObjectLiteral(Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, Scriptable scope)
public static Scriptable newObjectLiteral(Object[] propertyIds, Object[] propertyValues, Context cx, Scriptable scope)
Deprecated. This method only present for compatibility.
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.
public static Object newSpecial(Context cx, Object fun, Object[] args, Scriptable scope, int callType)
public static RuntimeException notFunctionError(Object value)
public static RuntimeException notFunctionError(Object value, Object messageHelper)
public static RuntimeException notFunctionError(Object obj, Object value, String propertyName)
public static String numberToString(double d, int base)
public static Object[] padArguments(Object[] args, int count)
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.
public static void setEnumNumbers(Object enumObj, boolean enumNumbers)
public static void setFunctionProtoAndParent(BaseFunction fn, Scriptable scope)
public static Object setName(Scriptable bound, Object value, Context cx, Scriptable scope, String id)
public static Object setObjectElem(Scriptable obj, Object elem, Object value, Context cx)
public static Object setObjectIndex(Object obj, double dblIndex, Object value, Context cx)
public static Object setObjectIndex(Scriptable obj, int index, Object value, Context cx)
public static Object setObjectProp(Object obj, String property, Object value, Context cx)
Version of setObjectElem when elem is a valid JS identifier name.
public static Object setObjectProp(Scriptable obj, String property, Object value, Context cx)
public static void setObjectProtoAndParent(ScriptableObject object, Scriptable scope)
public static boolean shallowEq(Object x, Object y)
public static long testUint32String(String str)
If str is a decimal presentation of Uint32 value, return it as long. Othewise return -1L;
public static boolean toBoolean(Object val)
Convert the value to a boolean. See ECMA 9.2.
public static int toInt32(Object val)
See ECMA 9.5.
public static int toInt32(Object[] args, int index)
public static int toInt32(double d)
public static double toInteger(Object val)
See ECMA 9.4.
public static double toInteger(Object[] args, int index)
public static double toInteger(double d)
public static Scriptable toIterator(Context cx, Scriptable scope, Scriptable obj, boolean keyOnly)
public static double toNumber(Object val)
Convert the value to a number. See ECMA 9.3.
public static double toNumber(Object[] args, int index)
public static double toNumber(String s)
ToNumber applied to the String type See ECMA 9.3.1
public static Scriptable toObject(Context cx, Scriptable scope, Object val)
Convert the value to an object. See ECMA 9.9.
public static Scriptable toObject(Context cx, Scriptable scope, Object val, Class staticClass)
Deprecated. Use
toObject(Context,Scriptable,Object)
instead.
public static Scriptable toObject(Scriptable scope, Object val, Class staticClass)
Deprecated. Use
toObject(Scriptable,Object)
instead.
public static String toString(Object val)
Convert the value to a string. See ECMA 9.8.
public static String toString(Object[] args, int index)
public static String toString(double val)
Optimized version of toString(Object) for numbers.
public static char toUint16(Object val)
See ECMA 9.7.
public static long toUint32(Object val)
public static long toUint32(double d)
See ECMA 9.6.
- Returns:
- long value representing 32 bits unsigned integer
public static EcmaError typeError3(String messageId, String arg1, String arg2, String arg3)
public static String typeof(Object value)
The typeof operator
public static String typeofName(Scriptable scope, String id)
The typeof operator that correctly handles the undefined case
public static RuntimeException undefCallError(Object object, Object id)
public static RuntimeException undefReadError(Object object, Object id)
public static RuntimeException undefWriteError(Object object, Object id, Object value)
public static Boolean wrapBoolean(boolean b)
public static Integer wrapInt(int i)
public static Number wrapNumber(double x)