com.google.javascript.rhino
Class ScriptRuntime

java.lang.Object
  extended by com.google.javascript.rhino.ScriptRuntime

public class ScriptRuntime
extends Object

This is the class that implements the runtime.


Field Summary
static Object[] emptyArgs
           
static String[] emptyStrings
           
static double NaN
           
static Double NaNobj
           
static double negativeZero
           
 
Constructor Summary
protected ScriptRuntime()
          No instances should be created.
 
Method Summary
static EcmaError constructError(String error, String message)
           
static EcmaError constructError(String error, String message, String sourceName, int lineNumber, String lineSource, int columnNumber)
           
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 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 boolean isJSLineTerminator(int c)
           
static long lastUint32Result(Context cx)
           
static RuntimeException notFunctionError(Object value)
           
static RuntimeException notFunctionError(Object value, Object messageHelper)
           
static String numberToString(double d, int base)
           
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 String toString(Object val)
          Convert the value to a string.
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 RuntimeException undefCallError(Object object, Object id)
           
static RuntimeException undefReadError(Object object, Object id)
           
static RuntimeException undefWriteError(Object object, Object id, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NaN

public static final double NaN

negativeZero

public static final double negativeZero

NaNobj

public static final Double NaNobj

emptyArgs

public static final Object[] emptyArgs

emptyStrings

public static final String[] emptyStrings
Constructor Detail

ScriptRuntime

protected ScriptRuntime()
No instances should be created.

Method Detail

isJSLineTerminator

public static boolean isJSLineTerminator(int c)

escapeString

public static String escapeString(String s)

escapeString

public static String escapeString(String s,
                                  char escapeQuote)
For escaping strings printed by object and array literals; not quite the same as 'escape.'


toString

public static String toString(Object val)
Convert the value to a string. See ECMA 9.8.


numberToString

public static String numberToString(double d,
                                    int base)

testUint32String

public static long testUint32String(String str)
If str is a decimal presentation of Uint32 value, return it as long. Othewise return -1L;


getMessage0

public static String getMessage0(String messageId)

getMessage1

public static String getMessage1(String messageId,
                                 Object arg1)

getMessage2

public static String getMessage2(String messageId,
                                 Object arg1,
                                 Object arg2)

getMessage3

public static String getMessage3(String messageId,
                                 Object arg1,
                                 Object arg2,
                                 Object arg3)

getMessage4

public static String getMessage4(String messageId,
                                 Object arg1,
                                 Object arg2,
                                 Object arg3,
                                 Object arg4)

getMessage

public static String getMessage(String messageId,
                                Object[] arguments)

constructError

public static EcmaError constructError(String error,
                                       String message)

constructError

public static EcmaError constructError(String error,
                                       String message,
                                       String sourceName,
                                       int lineNumber,
                                       String lineSource,
                                       int columnNumber)

typeError

public static EcmaError typeError(String message)

typeError0

public static EcmaError typeError0(String messageId)

typeError1

public static EcmaError typeError1(String messageId,
                                   String arg1)

typeError2

public static EcmaError typeError2(String messageId,
                                   String arg1,
                                   String arg2)

typeError3

public static EcmaError typeError3(String messageId,
                                   String arg1,
                                   String arg2,
                                   String arg3)

undefReadError

public static RuntimeException undefReadError(Object object,
                                              Object id)

undefCallError

public static RuntimeException undefCallError(Object object,
                                              Object id)

undefWriteError

public static RuntimeException undefWriteError(Object object,
                                               Object id,
                                               Object value)

notFunctionError

public static RuntimeException notFunctionError(Object value)

notFunctionError

public static RuntimeException notFunctionError(Object value,
                                                Object messageHelper)

storeUint32Result

public static void storeUint32Result(Context cx,
                                     long value)

lastUint32Result

public static long lastUint32Result(Context cx)