예제 #1
0
        public static RubyErrorProvider FromMessageAndBacktrace(MutableString message, RubyArray backtrace)
        {
            var rep = new RubyErrorProvider();

            rep.ParseFromBacktrace(message, backtrace);
            return(rep);
        }
예제 #2
0
        private void ScriptThreadProc()
        {
            ScriptScope scope = null;

            try
            {
                m_runningScript = true;

                var rep          = RubyErrorProvider.AsErrorSink();
                var compiledCode = m_scriptSrc.Compile(rep);
                if (compiledCode != null)
                {
                    scope = compiledCode.DefaultScope;
                    compiledCode.Execute();
                    ScriptHelper.SpinLoop(0.5, scope);
                }
                else
                {
                    TriggerErrorEvent(rep);
                }
            }
            catch (ThreadAbortException)
            { // We don't want to do anything special about thread aborts,
              // since these are usually invoked by the user
            }
            catch (Exception ex)
            {
                TriggerErrorEvent(RubyErrorProvider.ParseException(ex));
            }
            finally
            {
                // only execute if no syntax errors
                if (scope != null)
                {
                    ScriptHelper.SendMethodToModules("onFinish", scope);
                    ScriptHelper.ExecuteTopMethod("onFinish", scope);
                }
                m_runningScript = false;
                OnCompileFinished();
            }
        }
예제 #3
0
 public static RubyErrorProvider FromMessageAndBacktrace(MutableString message, RubyArray backtrace)
 {
     var rep = new RubyErrorProvider();
       rep.ParseFromBacktrace(message, backtrace);
       return rep;
 }
예제 #4
0
 private void TriggerErrorEvent(RubyErrorProvider rep)
 {
     OnScriptError(rep.Message, rep.Path, rep.Line, rep.Column, rep.Format);
 }
예제 #5
0
 private void TriggerErrorEventFromRuby(MutableString message, RubyArray backtrace)
 {
     TriggerErrorEvent(RubyErrorProvider.FromMessageAndBacktrace(message, backtrace));
 }
예제 #6
0
 private void TriggerErrorEvent(RubyErrorProvider rep)
 {
     OnScriptError(rep.Message, rep.Path, rep.Line, rep.Column, rep.Format);
 }