Examples of rb_clear()


Examples of org.jruby.RubyArray.rb_clear()

    public void testSetsValuesToNullOnClearWhenNotShared() throws Exception {
        final RubyArray arr = (RubyArray)runtime.evalScriptlet("$h = ['foo','bar']");
        assertNotSame("first element nil", runtime.getNil(), arr.eltInternal(0));
        assertNotSame("second element nil", runtime.getNil(), arr.eltInternal(1));
        arr.rb_clear();
        assertSame("first element not nil", runtime.getNil(), arr.eltInternal(0));
        assertSame("second element not nil", runtime.getNil(), arr.eltInternal(1));
    }

    public void testSetsLeftoverValuesToNullWhenRejectingElements() throws Exception {
View Full Code Here

Examples of org.jruby.RubyArray.rb_clear()

      // update id
      obj.setInstanceVariable("@code", new RubyFixnum(code.getObject().getRuntime(), nid));

      // set parameter
      RubyArray r = (RubyArray) code.getObject().getInstanceVariable("@parameters");
      r.rb_clear();
      r.add(code.getParameters().get(i));
      rawList.add(obj);

    }
  }
View Full Code Here

Examples of org.jruby.RubyArray.rb_clear()

    public void testSetsValuesToNullOnClearWhenNotShared() throws Exception {
        final RubyArray arr = (RubyArray)runtime.evalScriptlet("$h = ['foo','bar']");
        assertNotSame("first element nil", runtime.getNil(), arr.eltInternal(0));
        assertNotSame("second element nil", runtime.getNil(), arr.eltInternal(1));
        arr.rb_clear();
        assertSame("first element not nil", runtime.getNil(), arr.eltInternal(0));
        assertSame("second element not nil", runtime.getNil(), arr.eltInternal(1));
    }

    public void testSetsLeftoverValuesToNullWhenRejectingElements() throws Exception {
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.