Class 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
    • Constructor Detail

      • NativeGlobal

        public NativeGlobal()
    • Method Detail

      • 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)
      • 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)