org.mozilla.javascript
public class ScriptRuntime extends Object
| Field Summary | |
|---|---|
| static Class | BooleanClass |
| static Class | ByteClass |
| static Class | CharacterClass |
| static Class | ClassClass |
| static Class | ContextClass |
| static Class | ContextFactoryClass |
| static Class | DateClass |
| static Class | DoubleClass |
| static Object[] | emptyArgs |
| static String[] | emptyStrings |
| static Class | FloatClass |
| static Class | FunctionClass |
| static Class | IntegerClass |
| static Class | LongClass |
| static double | negativeZero |
| static double | NaN |
| static Double | NaNobj |
| static Class | NumberClass |
| static Class | ObjectClass |
| static Class | ScriptableClass |
| static Class | ScriptableObjectClass |
| static Class | ShortClass |
| static Class | StringClass |
| Constructor Summary | |
|---|---|
| protected | ScriptRuntime()
No instances should be created. |
| Method Summary | |
|---|---|
| static Object | add(Object val1, Object val2, Context cx) |
| 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] |
| static Scriptable | bind(Context cx, Scriptable scope, String id)
Returns the object in the scope chain that has a given property.
|
| static Object | call(Context cx, Object fun, Object thisArg, Object[] args, Scriptable scope) |
| static Ref | callRef(Callable function, Scriptable thisObj, Object[] args, Context cx)
Perform function call in reference context. |
| static Object | callSpecial(Context cx, Callable fun, Scriptable thisObj, Object[] args, Scriptable scope, Scriptable callerThis, int callType, String filename, int lineNumber) |
| static RegExpProxy | checkRegExpProxy(Context cx) |
| static boolean | cmp_LE(Object val1, Object val2) |
| static boolean | cmp_LT(Object val1, Object val2) |
| static EcmaError | constructError(String error, String message) |
| static EcmaError | constructError(String error, String message, String sourceName, int lineNumber, String lineSource, int columnNumber) |
| static Scriptable | createFunctionActivation(NativeFunction funObj, Scriptable scope, Object[] args) |
| 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. |
| static boolean | deleteObjectElem(Scriptable target, Object elem, Context cx) |
| static Object | doTopCall(Callable callable, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) |
| static Object | elemIncrDecr(Object obj, Object index, Context cx, int incrDecrMask) |
| static void | enterActivationFunction(Context cx, Scriptable activation) |
| static Scriptable | enterDotQuery(Object value, Scriptable scope) |
| static Scriptable | enterWith(Object obj, Context cx, Scriptable scope) |
| static Object | enumId(Object enumObj, Context cx) |
| static Object | enumInit(Object value, Context cx, boolean enumValues) |
| static Boolean | enumNext(Object enumObj) |
| static boolean | eq(Object x, Object y)
Equality
See ECMA 11.9 |
| static String | escapeAttributeValue(Object value, Context cx)
Escapes the reserved characters in a value of an attribute
|
| static String | escapeString(String s) |
| static String | escapeString(String s, char escapeQuote)
For escaping strings printed by object and array literals; not quite
the same as 'escape.' |
| static String | escapeTextValue(Object value, Context cx)
Escapes the reserved characters in a value of a text node
|
| static Object | evalSpecial(Context cx, Scriptable scope, Object thisArg, Object[] args, String filename, int lineNumber)
The eval function property of the global object.
|
| static void | exitActivationFunction(Context cx) |
| static Object[] | getArrayElements(Scriptable object) |
| 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.
|
| static ScriptableObject | getGlobal(Context cx) |
| static ScriptableObject | getLibraryScopeOrNull(Scriptable scope) |
| static String | getMessage(String messageId, Object[] arguments) |
| static String | getMessage0(String messageId) |
| static String | getMessage1(String messageId, Object arg1) |
| static String | getMessage2(String messageId, Object arg1, Object arg2) |
| static String | getMessage3(String messageId, Object arg1, Object arg2, Object arg3) |
| static String | getMessage4(String messageId, Object arg1, Object arg2, Object arg3, Object arg4) |
| 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.
|
| static Object | getObjectElem(Object obj, Object elem, Context cx)
Call obj.[[Get]](id) |
| static Object | getObjectElem(Scriptable obj, Object elem, Context cx) |
| static Object | getObjectIndex(Object obj, double dblIndex, Context cx) |
| static Object | getObjectIndex(Scriptable obj, int index, Context cx) |
| static Object | getObjectProp(Object obj, String property, Context cx)
Version of getObjectElem when elem is a valid JS identifier name. |
| static Object | getObjectProp(Scriptable obj, String property, Context cx) |
| 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.
|
| static RegExpProxy | getRegExpProxy(Context cx) |
| static Scriptable | getTopCallScope(Context cx) |
| static Object | getTopLevelProp(Scriptable scope, String id) |
| static Callable | getValueFunctionAndThis(Object value, Context cx)
Prepare for calling |
| static boolean | hasObjectElem(Scriptable target, Object elem, Context cx) |
| static boolean | hasTopCall(Context cx) |
| static boolean | in(Object a, Object b, Context cx)
The in operator.
|
| static void | initFunction(Context cx, Scriptable scope, NativeFunction function, int type, boolean fromEvalCode) |
| static void | initScript(NativeFunction funObj, Scriptable thisObj, Context cx, Scriptable scope, boolean evalScript) |
| static ScriptableObject | initStandardObjects(Context cx, ScriptableObject scope, boolean sealed) |
| static boolean | instanceOf(Object a, Object b, Context cx)
The instanceof operator.
|
| static boolean | isArrayObject(Object obj) |
| static boolean | isJSLineTerminator(int c) |
| static boolean | isRhinoRuntimeType(Class cl) |
| protected static boolean | jsDelegatesTo(Scriptable lhs, Scriptable rhs)
Delegates to
|
| static Scriptable | lastStoredScriptable(Context cx) |
| static long | lastUint32Result(Context cx) |
| static Scriptable | leaveDotQuery(Scriptable scope) |
| static Scriptable | leaveWith(Scriptable scope) |
| static Ref | memberRef(Object obj, Object elem, Context cx, int memberTypeFlags) |
| static Ref | memberRef(Object obj, Object namespace, Object elem, Context cx, int memberTypeFlags) |
| static Object | name(Context cx, Scriptable scope, String name)
Looks up a name in the scope chain and returns its value. |
| static Object | nameIncrDecr(Scriptable scopeChain, String id, int incrDecrMask) |
| static Ref | nameRef(Object name, Context cx, Scriptable scope, int memberTypeFlags) |
| static Ref | nameRef(Object namespace, Object name, Context cx, Scriptable scope, int memberTypeFlags) |
| static Scriptable | newArrayLiteral(Object[] objects, int[] skipIndexces, Context cx, Scriptable scope) |
| static Scriptable | newCatchScope(Throwable t, Scriptable lastCatchScope, String exceptionName, Context cx, Scriptable scope) |
| static Scriptable | newObject(Context cx, Scriptable scope, String constructorName, Object[] args) |
| static Scriptable | newObject(Object fun, Context cx, Scriptable scope, Object[] args)
Operator new.
|
| static Scriptable | newObjectLiteral(Object[] propertyIds, Object[] propertyValues, Context cx, Scriptable scope) |
| static Object | newSpecial(Context cx, Object fun, Object[] args, Scriptable scope, int callType) |
| static RuntimeException | notFoundError(Scriptable object, String property) |
| static RuntimeException | notFunctionError(Object value) |
| static RuntimeException | notFunctionError(Object value, Object messageHelper) |
| static String | numberToString(double d, int base) |
| static Object[] | padArguments(Object[] args, int count)
Helper function for builtin objects that use the varargs form.
|
| static Object | propIncrDecr(Object obj, String id, Context cx, int incrDecrMask) |
| static Object | refDel(Ref ref, Context cx) |
| static Object | refGet(Ref ref, Context cx) |
| static Object | refIncrDecr(Ref ref, Context cx, int incrDecrMask) |
| static Object | refSet(Ref ref, Object value, Context cx) |
| static Object | searchDefaultNamespace(Context cx) |
| static Object | setDefaultNamespace(Object namespace, Context cx) |
| static void | setFunctionProtoAndParent(BaseFunction fn, Scriptable scope) |
| static Object | setName(Scriptable bound, Object value, Context cx, Scriptable scope, String id) |
| static Object | setObjectElem(Object obj, Object elem, Object value, Context cx) |
| static Object | setObjectElem(Scriptable obj, Object elem, Object value, Context cx) |
| static Object | setObjectIndex(Object obj, double dblIndex, Object value, Context cx) |
| static Object | setObjectIndex(Scriptable obj, int index, Object value, Context cx) |
| static Object | setObjectProp(Object obj, String property, Object value, Context cx)
Version of setObjectElem when elem is a valid JS identifier name. |
| static Object | setObjectProp(Scriptable obj, String property, Object value, Context cx) |
| static void | setObjectProtoAndParent(ScriptableObject object, Scriptable scope) |
| static void | setRegExpProxy(Context cx, RegExpProxy proxy) |
| static boolean | shallowEq(Object x, Object y) |
| static Ref | specialRef(Object obj, String specialProperty, Context cx) |
| static void | storeUint32Result(Context cx, long value) |
| static long | testUint32String(String str)
If str is a decimal presentation of Uint32 value, return it as long.
|
| static boolean | toBoolean(Object val)
Convert the value to a boolean.
|
| static boolean | toBoolean(Object[] args, int index) |
| static int | toInt32(Object val)
See ECMA 9.5. |
| static int | toInt32(Object[] args, int index) |
| static int | toInt32(double d) |
| static double | toInteger(Object val)
See ECMA 9.4. |
| static double | toInteger(double d) |
| static double | toInteger(Object[] args, int index) |
| static double | toNumber(Object val)
Convert the value to a number.
|
| static double | toNumber(Object[] args, int index) |
| static double | toNumber(String s)
ToNumber applied to the String type
See ECMA 9.3.1 |
| static Scriptable | toObject(Scriptable scope, Object val) |
| static Scriptable | toObject(Scriptable scope, Object val, Class staticClass) |
| static Scriptable | toObject(Context cx, Scriptable scope, Object val)
Convert the value to an object.
|
| static Scriptable | toObject(Context cx, Scriptable scope, Object val, Class staticClass) |
| static Scriptable | toObjectOrNull(Context cx, Object obj) |
| static String | toString(Object val)
Convert the value to a string.
|
| static String | toString(Object[] args, int index) |
| static String | toString(double val)
Optimized version of toString(Object) for numbers. |
| static char | toUint16(Object val)
See ECMA 9.7. |
| static long | toUint32(double d)
See ECMA 9.6. |
| static long | toUint32(Object val) |
| static EcmaError | typeError(String message) |
| static EcmaError | typeError0(String messageId) |
| static EcmaError | typeError1(String messageId, String arg1) |
| static EcmaError | typeError2(String messageId, String arg1, String arg2) |
| static EcmaError | typeError3(String messageId, String arg1, String arg2, String arg3) |
| static String | typeof(Object value)
The typeof operator |
| static String | typeofName(Scriptable scope, String id)
The typeof operator that correctly handles the undefined case |
| static RuntimeException | undefCallError(Object object, Object id) |
| static RuntimeException | undefReadError(Object object, Object id) |
| static RuntimeException | undefWriteError(Object object, Object id, Object value) |
| static Object | updateDotQuery(boolean value, Scriptable scope) |
| static Boolean | wrapBoolean(boolean b) |
| static Integer | wrapInt(int i) |
| static Number | wrapNumber(double x) |
Deprecated: The method is only present for compatibility.
Parameters: value Unescaped text
Returns: The escaped text
Parameters: value Unescaped text
Returns: The escaped text
Parameters: a the left hand operand b the right hand operand
Returns: true if property name or element number a is a property of b
Returns: a instanceof b
Returns: true iff rhs appears in lhs' proto chain
Deprecated: Use ScriptRuntime instead.
Deprecated: Use ScriptRuntime instead.
Returns: long value representing 32 bits unsigned integer