Package org.mozilla.javascript
Class NativeGlobal
java.lang.Object
org.mozilla.javascript.NativeGlobal
- All Implemented Interfaces:
Serializable
,IdFunctionCall
This class implements the global native object (function and value properties only).
See ECMA 15.1.[12].
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Object
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
(package private) static final long
private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EcmaError
constructError
(Context cx, String error, String message, Scriptable scope) Deprecated.static EcmaError
constructError
(Context cx, String error, String message, Scriptable scope, String sourceName, int lineNumber, int columnNumber, String lineSource) Deprecated.private static String
private static String
private static boolean
encodeUnescaped
(char c, boolean fullUri) execIdCall
(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, 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
(Object functionObj) private static Object
The global method escape, as per ECMA-262 15.1.2.4.private static Object
js_eval
(Context cx, Scriptable scope, Object[] args) This is an indirect call to eval, and thus uses the global environment.(package private) static Object
js_parseFloat
(Object[] args) The global method parseFloat, as per ECMA-262 15.1.2.3.(package private) static Object
js_parseInt
(Object[] args) The global method parseInt, as per ECMA-262 15.1.2.2.private static Object
js_unescape
(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 Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
URI_DECODE_RESERVED
- See Also:
-
INVALID_UTF8
private static final int INVALID_UTF8- See Also:
-
FTAG
-
Id_decodeURI
private static final int Id_decodeURI- See Also:
-
Id_decodeURIComponent
private static final int Id_decodeURIComponent- See Also:
-
Id_encodeURI
private static final int Id_encodeURI- See Also:
-
Id_encodeURIComponent
private static final int Id_encodeURIComponent- See Also:
-
Id_escape
private static final int Id_escape- See Also:
-
Id_eval
private static final int Id_eval- See Also:
-
Id_isFinite
private static final int Id_isFinite- See Also:
-
Id_isNaN
private static final int Id_isNaN- See Also:
-
Id_isXMLName
private static final int Id_isXMLName- See Also:
-
Id_parseFloat
private static final int Id_parseFloat- See Also:
-
Id_parseInt
private static final int Id_parseInt- See Also:
-
Id_unescape
private static final int Id_unescape- See Also:
-
Id_uneval
private static final int Id_uneval- See Also:
-
LAST_SCOPE_FUNCTION_ID
private static final int LAST_SCOPE_FUNCTION_ID- See Also:
-
Id_new_CommonError
private static final int Id_new_CommonError- See Also:
-
-
Constructor Details
-
NativeGlobal
public NativeGlobal()
-
-
Method Details
-
init
-
execIdCall
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, 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
The global method parseInt, as per ECMA-262 15.1.2.2. -
js_parseFloat
The global method parseFloat, as per ECMA-262 15.1.2.3.- Parameters:
args
- the arguments to parseFloat, ignoring args[>=1]
-
js_escape
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
The global unescape method, as per ECMA-262 15.1.2.5. -
js_eval
This is an indirect call to eval, and thus uses the global environment. Direct calls are executed via ScriptRuntime.callSpecial(). -
isEvalFunction
-
constructError
@Deprecated public static EcmaError constructError(Context cx, String error, String message, Scriptable scope) Deprecated.UseScriptRuntime.constructError(String,String)
instead. -
constructError
@Deprecated public static EcmaError constructError(Context cx, String error, String message, Scriptable scope, String sourceName, int lineNumber, int columnNumber, String lineSource) Deprecated. -
encode
-
toHexChar
private static char toHexChar(int i) -
unHex
private static int unHex(char c) -
unHex
private static int unHex(char c1, char c2) -
decode
-
encodeUnescaped
private static boolean encodeUnescaped(char c, boolean fullUri) -
uriError
-
oneUcs4ToUtf8Char
private static int oneUcs4ToUtf8Char(byte[] utf8Buffer, int ucs4Char)
-
ScriptRuntime.constructError(String,String)
instead.