Ejemplo n.º 1
0
        public static void RaiseException(Thread /*!*/ self, [NotNull] MutableString /*!*/ message)
        {
            if (self == Thread.CurrentThread)
            {
                KernelOps.RaiseException(self, message);
                return;
            }

#if SILVERLIGHT
            throw new NotImplementedError("Thread#raise is not implemented on Silverlight");
#else
            Exception e = RubyExceptionData.InitializeException(new RuntimeError(message.ToString()), message);
            RaiseAsyncException(self, e);
#endif
        }
Ejemplo n.º 2
0
        public static void RaiseException(Thread /*!*/ self, [NotNull] MutableString /*!*/ message)
        {
            if (self == Thread.CurrentThread)
            {
                KernelOps.RaiseException(self, message);
                return;
            }

#if FEATURE_EXCEPTION_STATE
            Exception e = RubyExceptionData.InitializeException(new RuntimeError(message.ToString()), message);
            RaiseAsyncException(self, e);
#else
            throw new NotImplementedError("Thread#raise not supported on this platform");
#endif
        }
Ejemplo n.º 3
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
        }
Ejemplo n.º 4
0
        public static void RaiseException(RubyContext /*!*/ context, Thread /*!*/ self)
        {
            if (self == Thread.CurrentThread)
            {
                KernelOps.RaiseException(context, self);
                return;
            }

#if SILVERLIGHT
            throw new NotImplementedError("Thread#raise is not implemented on Silverlight");
#else
            // TODO: RubyContext.CurrentException is a thread-local static, and cannot be accessed from other threads
            // To fix this, it would have to be stored somehow without using ThreadStaticAttribute
            // For now, we just throw a RuntimeError
            RaiseAsyncException(self, new RuntimeError());
#endif
        }
Ejemplo n.º 5
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
        }
Ejemplo n.º 6
0
        public static void RaiseException(RubyContext /*!*/ context, Thread /*!*/ self)
        {
            if (self == Thread.CurrentThread)
            {
                KernelOps.RaiseException(context, self);
                return;
            }

#if FEATURE_EXCEPTION_STATE
            // TODO: RubyContext.CurrentException is a thread-local static, and cannot be accessed from other threads
            // To fix this, it would have to be stored somehow without using ThreadStaticAttribute
            // For now, we just throw a RuntimeError
            RaiseAsyncException(self, new RuntimeError());
#else
            throw new NotImplementedError("Thread#raise not supported on this platform");
#endif
        }