Exemple #1
0
        public static void RaiseException(RespondToStorage /*!*/ respondToStorage, UnaryOpStorage /*!*/ storage0, BinaryOpStorage /*!*/ storage1,
                                          CallSiteStorage <Action <CallSite, Exception, RubyArray> > /*!*/ setBackTraceStorage,
                                          Thread /*!*/ self, object /*!*/ obj, [Optional] object arg, [Optional] RubyArray backtrace)
        {
            if (self == Thread.CurrentThread)
            {
                KernelOps.RaiseException(respondToStorage, storage0, storage1, setBackTraceStorage, self, obj, arg, backtrace);
                return;
            }

#if SILVERLIGHT
            throw new NotImplementedError("Thread#raise is not implemented on Silverlight");
#else
            Exception e = KernelOps.CreateExceptionToRaise(respondToStorage, storage0, storage1, setBackTraceStorage, obj, arg, backtrace);
            RaiseAsyncException(self, e);
#endif
        }
Exemple #2
0
        public static void RaiseException(RespondToStorage /*!*/ respondToStorage, UnaryOpStorage /*!*/ storage0, BinaryOpStorage /*!*/ storage1,
                                          CallSiteStorage <Action <CallSite, Exception, RubyArray> > /*!*/ setBackTraceStorage,
                                          Thread /*!*/ self, object /*!*/ obj, [Optional] object arg, [Optional] RubyArray backtrace)
        {
            if (self == Thread.CurrentThread)
            {
                KernelOps.RaiseException(respondToStorage, storage0, storage1, setBackTraceStorage, self, obj, arg, backtrace);
                return;
            }

#if FEATURE_EXCEPTION_STATE
            Exception e = KernelOps.CreateExceptionToRaise(respondToStorage, storage0, storage1, setBackTraceStorage, obj, arg, backtrace);
            RaiseAsyncException(self, e);
#else
            throw new NotImplementedError("Thread#raise not supported on this platform");
#endif
        }