Logo Search packages:      
Sourcecode: jruby1.1 version File versions

IRubyObject org::jruby::RubyObject::dup (  )  [inline, inherited]


This method should be overridden only by: Proc

Will allocate a new instance of the real class of this object, and then initialize that copy. It's different from rbClone in that it doesn't copy the singleton class.

Implements org::jruby::runtime::builtin::IRubyObject.

Reimplemented in org::jruby::RubyProc.

Definition at line 1335 of file RubyObject.java.

References org::jruby::runtime::builtin::IRubyObject::setTaint().

Referenced by org::jruby::RubyKernel::chomp().

        if (isImmediate()) throw getRuntime().newTypeError("can't dup " + getMetaClass().getName());

        IRubyObject dup = getMetaClass().getRealClass().allocate();
        if (isTaint()) dup.setTaint(true);

        initCopy(dup, this);

        return dup;

Generated by  Doxygen 1.6.0   Back to index