public IRubyObject yield(ThreadContext context, IRubyObject arg) { synchronized (result) { if (i == 0) { // While iterating over an RubyEnumerator, "arg" // gets overwritten by the new value, leading to JRUBY-6892. // So call .dup() whenever appropriate. result.append(arg.isImmediate() ? arg : arg.dup()); } else { --i; } } return runtime.getNil(); } });
public IRubyObject yield(ThreadContext context, IRubyObject arg) { synchronized (result) { if (i == 0) { // While iterating over an RubyEnumerator, "arg" // gets overwritten by the new value, leading to JRUBY-6892. // So call .dup() whenever appropriate. result.append(arg.isImmediate() ? arg : arg.dup()); } else { --i; } } return runtime.getNil(); } });
private static String errMessageType(ThreadContext context, IRubyObject value) { if (value == null || value == context.nil) return "nil"; if (value.isImmediate()) return RubyObject.inspect(context, value).toString(); return value.getMetaClass().getBaseName(); }
private static String errMessageType(ThreadContext context, IRubyObject value) { if (value == null || value == context.nil) return "nil"; if (value.isImmediate()) return RubyObject.inspect(context, value).toString(); return value.getMetaClass().getBaseName(); }
private static RubyBigDecimal cannotBeCoerced(ThreadContext context, IRubyObject v, boolean must) { if (must) { String err; if (v.isImmediate()) { err = RubyObject.inspect(context, v).toString(); } else { err = v.getMetaClass().getBaseName(); } throw context.runtime.newTypeError(err + " can't be coerced into BigDecimal"); } return null; }
private static RubyBigDecimal cannotBeCoerced(ThreadContext context, IRubyObject v, boolean must) { if (must) { String err; if (v.isImmediate()) { err = RubyObject.inspect(context, v).toString(); } else { err = v.getMetaClass().getBaseName(); } throw context.runtime.newTypeError(err + " can't be coerced into BigDecimal"); } return null; }
/** rb_cmperr * */ public static IRubyObject cmperr(IRubyObject recv, IRubyObject other) { IRubyObject target; if (other.isImmediate() || !(other.isNil() || other.isTrue() || other == recv.getRuntime().getFalse())) { target = other.inspect(); } else { target = other.getType(); } throw recv.getRuntime().newArgumentError("comparison of " + recv.getType() + " with " + target + " failed"); }
/** rb_cmperr * */ public static IRubyObject cmperr(IRubyObject recv, IRubyObject other) { IRubyObject target; if (other.isImmediate() || !(other.isNil() || other.isTrue() || other == recv.getRuntime().getFalse())) { target = other.inspect(); } else { target = other.getType(); } throw recv.getRuntime().newArgumentError("comparison of " + recv.getType() + " with " + target + " failed"); }
/** rb_cmperr * */ public static IRubyObject cmperr(IRubyObject recv, IRubyObject other) { IRubyObject target; if (other.isImmediate() || !(other.isNil() || other.isTrue() || other == recv.getRuntime().getFalse())) { target = other.inspect(); } else { target = other.getType(); } throw recv.getRuntime().newArgumentError("comparison of " + recv.getType() + " with " + target + " failed"); }
/** rb_cmperr * */ public static IRubyObject cmperr(IRubyObject recv, IRubyObject other) { IRubyObject target; if (other.isImmediate() || !(other.isNil() || other.isTrue() || other == recv.getRuntime().getFalse())) { target = other.inspect(); } else { target = other.getType(); } throw recv.getRuntime().newArgumentError("comparison of " + recv.getType() + " with " + target + " failed"); }
!value.isImmediate() && value.hasVariables() && nativeClassIndex != ClassIndex.CLASS
!value.isImmediate() && value.hasVariables() && nativeClassIndex != ClassIndex.CLASS
!value.isImmediate() && value.hasVariables() && nativeTypeIndex != ClassIndex.CLASS
!value.isImmediate() && value.hasVariables() && nativeTypeIndex != ClassIndex.CLASS