Examples of newArray()


Examples of org.jruby.Ruby.newArray()

        @JRubyMethod(name = "to_a")
        public static IRubyObject s_hist_to_a(IRubyObject recv) {
            Ruby runtime = recv.getRuntime();
            ConsoleHolder holder = getHolder(runtime);
            RubyArray histList = runtime.newArray();

            for (Iterator i = holder.history.getHistoryList().iterator(); i.hasNext();) {
                histList.append(runtime.newString((String) i.next()));
            }
View Full Code Here

Examples of org.jruby.Ruby.newArray()

            InetAddress addr;
            String hostString = hostname.convertToString().toString();
            addr = InetAddress.getByName(hostString);
           
            ret[0] = r.newString(do_not_reverse_lookup(recv).isTrue() ? addr.getHostAddress() : addr.getCanonicalHostName());
            ret[1] = r.newArray();
            ret[3] = r.newString(addr.getHostAddress());
           
            if (addr instanceof Inet4Address) {
                Inet4Address addr4 = (Inet4Address)addr;
                ret[2] = r.newFixnum(AF_INET); //AF_INET
View Full Code Here

Examples of org.jruby.Ruby.newArray()

    public static class OpenSSLModule {

        @JRubyMethod(name = "errors", meta = true)
        public static IRubyObject errors(IRubyObject recv) {
            Ruby runtime = recv.getRuntime();
            RubyArray result = runtime.newArray();
            for (X509Error.ErrorException e : X509Error.getErrors()) {
                result.add(runtime.newString(e.getMessage()));
            }
            return result;
        }
View Full Code Here

Examples of org.jruby.Ruby.newArray()

            ReceiveTuple tuple = doReceiveNonblockTuple(runtime, length);

            IRubyObject addressArray = addrFor(context, tuple.sender, false);

            return runtime.newArray(tuple.result, addressArray);

        } catch (UnknownHostException e) {
            throw SocketUtils.sockerr(runtime, "recvfrom: name or service not known");

        } catch (PortUnreachableException e) {
View Full Code Here

Examples of org.jruby.Ruby.newArray()

            ReceiveTuple tuple = doReceiveTuple(runtime, length);

            IRubyObject addressArray = addrFor(context, tuple.sender, false);

            return runtime.newArray(tuple.result, addressArray);

        } catch (UnknownHostException e) {
            throw SocketUtils.sockerr(runtime, "recvfrom: name or service not known");

        } catch (PortUnreachableException e) {
View Full Code Here

Examples of org.jruby.Ruby.newArray()

        try {
            if (resultSet == null) {
                return FALSE;
            }

            values = runtime.newArray(fieldTypes.size());

            try {
                opened = resultSet.next();

                if (!opened) {
View Full Code Here

Examples of org.mozilla.javascript.Context.newArray()

        public XLoper execute(IFunctionContext context, XLoper[] args) throws RequestException {
            Context ctx = Context.enter();
            Object[] oargs = converter.convert(args, BSFScript.createArgHints(args));
            ScriptableObject so = ctx.initStandardObjects();
            Scriptable argsObj = ctx.newArray(so, oargs);
            so.defineProperty("args", argsObj, ScriptableObject.DONTENUM);
            try {
                return converter.createFrom(script.exec(ctx, so));
            } catch (Throwable t) {
                throw new RequestException(t.getMessage());
View Full Code Here

Examples of org.mozilla.javascript.Context.newArray()

            } else {
                int length = args.length;
                array = new Object[length];
                System.arraycopy(args, 0, array, 0, length);
            }
            Scriptable argsObj = cx.newArray(runner, array);
           
            runner.defineProperty("arguments", argsObj, ScriptableObject.DONTENUM);
           
            for(String key : globalVariables.keySet()) {
                runner.defineProperty(key, globalVariables.get( key ), ScriptableObject.DONTENUM);
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.newArray()

        if (clinit != null) {
          Type[] formals = m.getArgumentTypes();
          clinit.push(Type.getType(itf));
          clinit.push(m.getName());
          clinit.push(formals.length);
          clinit.newArray(CLASS);
          for (int j = 0; j < formals.length; ++j) {
            clinit.dup();
            clinit.push(j);
            clinit.push(formals[j]);
            clinit.arrayStore(CLASS);
View Full Code Here

Examples of org.objectweb.asm.commons.GeneratorAdapter.newArray()

      // push the method name string arg onto the stack
      staticAdapter.push(m.method.getName());

      // create an array of the method parm class[] arg
      staticAdapter.push(targetMethodParameters.length);
      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
        staticAdapter.push(t);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.