Package org.mozilla.javascript
Class NativeGlobal
- java.lang.Object
-
- org.mozilla.javascript.NativeGlobal
-
- All Implemented Interfaces:
java.io.Serializable
,IdFunctionCall
public class NativeGlobal extends java.lang.Object implements java.io.Serializable, IdFunctionCall
This class implements the global native object (function and value properties only).See ECMA 15.1.[12].
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Object
FTAG
private static int
Id_decodeURI
private static int
Id_decodeURIComponent
private static int
Id_encodeURI
private static int
Id_encodeURIComponent
private static int
Id_escape
private static int
Id_eval
private static int
Id_isFinite
private static int
Id_isNaN
private static int
Id_isXMLName
private static int
Id_new_CommonError
private static int
Id_parseFloat
private static int
Id_parseInt
private static int
Id_unescape
private static int
Id_uneval
private static int
INVALID_UTF8
private static int
LAST_SCOPE_FUNCTION_ID
(package private) static long
serialVersionUID
private static java.lang.String
URI_DECODE_RESERVED
-
Constructor Summary
Constructors Constructor Description NativeGlobal()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static EcmaError
constructError(Context cx, java.lang.String error, java.lang.String message, Scriptable scope)
Deprecated.UseScriptRuntime.constructError(String,String)
instead.static EcmaError
constructError(Context cx, java.lang.String error, java.lang.String message, Scriptable scope, java.lang.String sourceName, int lineNumber, int columnNumber, java.lang.String lineSource)
Deprecated.private static java.lang.String
decode(java.lang.String str, boolean fullUri)
private static java.lang.String
encode(java.lang.String str, boolean fullUri)
private static boolean
encodeUnescaped(char c, boolean fullUri)
java.lang.Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returnedstatic void
init(Context cx, Scriptable scope, boolean sealed)
(package private) static boolean
isEvalFunction(java.lang.Object functionObj)
private static java.lang.Object
js_escape(java.lang.Object[] args)
The global method escape, as per ECMA-262 15.1.2.4.private static java.lang.Object
js_eval(Context cx, Scriptable scope, java.lang.Object[] args)
This is an indirect call to eval, and thus uses the global environment.(package private) static java.lang.Object
js_parseFloat(java.lang.Object[] args)
The global method parseFloat, as per ECMA-262 15.1.2.3.(package private) static java.lang.Object
js_parseInt(java.lang.Object[] args)
The global method parseInt, as per ECMA-262 15.1.2.2.private static java.lang.Object
js_unescape(java.lang.Object[] args)
The global unescape method, as per ECMA-262 15.1.2.5.private static int
oneUcs4ToUtf8Char(byte[] utf8Buffer, int ucs4Char)
private static char
toHexChar(int i)
private static int
unHex(char c)
private static int
unHex(char c1, char c2)
private static EcmaError
uriError()
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
URI_DECODE_RESERVED
private static final java.lang.String URI_DECODE_RESERVED
- See Also:
- Constant Field Values
-
INVALID_UTF8
private static final int INVALID_UTF8
- See Also:
- Constant Field Values
-
FTAG
private static final java.lang.Object FTAG
-
Id_decodeURI
private static final int Id_decodeURI
- See Also:
- Constant Field Values
-
Id_decodeURIComponent
private static final int Id_decodeURIComponent
- See Also:
- Constant Field Values
-
Id_encodeURI
private static final int Id_encodeURI
- See Also:
- Constant Field Values
-
Id_encodeURIComponent
private static final int Id_encodeURIComponent
- See Also:
- Constant Field Values
-
Id_escape
private static final int Id_escape
- See Also:
- Constant Field Values
-
Id_eval
private static final int Id_eval
- See Also:
- Constant Field Values
-
Id_isFinite
private static final int Id_isFinite
- See Also:
- Constant Field Values
-
Id_isNaN
private static final int Id_isNaN
- See Also:
- Constant Field Values
-
Id_isXMLName
private static final int Id_isXMLName
- See Also:
- Constant Field Values
-
Id_parseFloat
private static final int Id_parseFloat
- See Also:
- Constant Field Values
-
Id_parseInt
private static final int Id_parseInt
- See Also:
- Constant Field Values
-
Id_unescape
private static final int Id_unescape
- See Also:
- Constant Field Values
-
Id_uneval
private static final int Id_uneval
- See Also:
- Constant Field Values
-
LAST_SCOPE_FUNCTION_ID
private static final int LAST_SCOPE_FUNCTION_ID
- See Also:
- Constant Field Values
-
Id_new_CommonError
private static final int Id_new_CommonError
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public static void init(Context cx, Scriptable scope, boolean sealed)
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from interface:IdFunctionCall
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned- Specified by:
execIdCall
in interfaceIdFunctionCall
-
js_parseInt
static java.lang.Object js_parseInt(java.lang.Object[] args)
The global method parseInt, as per ECMA-262 15.1.2.2.
-
js_parseFloat
static java.lang.Object js_parseFloat(java.lang.Object[] args)
The global method parseFloat, as per ECMA-262 15.1.2.3.- Parameters:
args
- the arguments to parseFloat, ignoring args[>=1]
-
js_escape
private static java.lang.Object js_escape(java.lang.Object[] args)
The global method escape, as per ECMA-262 15.1.2.4.Includes code for the 'mask' argument supported by the C escape method, which used to be part of the browser embedding. Blame for the strange constant names should be directed there.
-
js_unescape
private static java.lang.Object js_unescape(java.lang.Object[] args)
The global unescape method, as per ECMA-262 15.1.2.5.
-
js_eval
private static java.lang.Object js_eval(Context cx, Scriptable scope, java.lang.Object[] args)
This is an indirect call to eval, and thus uses the global environment. Direct calls are executed via ScriptRuntime.callSpecial().
-
isEvalFunction
static boolean isEvalFunction(java.lang.Object functionObj)
-
constructError
@Deprecated public static EcmaError constructError(Context cx, java.lang.String error, java.lang.String message, Scriptable scope)
Deprecated.UseScriptRuntime.constructError(String,String)
instead.
-
constructError
@Deprecated public static EcmaError constructError(Context cx, java.lang.String error, java.lang.String message, Scriptable scope, java.lang.String sourceName, int lineNumber, int columnNumber, java.lang.String lineSource)
Deprecated.
-
encode
private static java.lang.String encode(java.lang.String str, boolean fullUri)
-
toHexChar
private static char toHexChar(int i)
-
unHex
private static int unHex(char c)
-
unHex
private static int unHex(char c1, char c2)
-
decode
private static java.lang.String decode(java.lang.String str, boolean fullUri)
-
encodeUnescaped
private static boolean encodeUnescaped(char c, boolean fullUri)
-
uriError
private static EcmaError uriError()
-
oneUcs4ToUtf8Char
private static int oneUcs4ToUtf8Char(byte[] utf8Buffer, int ucs4Char)
-
-