Exemple #1
0
        // We don't define "dup" here because "dup" shouldn't show up on builtin types like Hash
        // (Kernel#dup just works for these types)
        private static IDictionary <object, object> /*!*/ Duplicate(RubyContext /*!*/ context, IDictionary <object, object> /*!*/ self)
        {
            // Call Kernel#dup, then copy items
            var copy = (IDictionary <object, object>)KernelOps.Duplicate(context, self);

            return(ReplaceData(copy, self));
        }
Exemple #2
0
        // We don't define "dup" here because "dup" shouldn't show up on builtin types like Hash
        // (Kernel#dup just works for these types)
        private static IDictionary <object, object> /*!*/ Duplicate(
            CallSiteStorage <Func <CallSite, object, object, object> > /*!*/ initializeCopyStorage,
            CallSiteStorage <Func <CallSite, RubyClass, object> > /*!*/ allocateStorage,
            IDictionary <object, object> /*!*/ self)
        {
            // Call Kernel#dup, then copy items
            var copy = (IDictionary <object, object>)KernelOps.Duplicate(initializeCopyStorage, allocateStorage, self);

            return(ReplaceData(copy, self));
        }