[Ironruby-core] Can't run script after engine exception

Michael Letterle michael.letterle at gmail.com
Tue Feb 19 07:25:20 EST 2008


Note that this happens in rbx as well, if you make a syntax error, you
can't do any thing any more and have to exit the interpreter.

On Feb 18, 2008 11:32 PM, Tomas Matousek <Tomas.Matousek at microsoft.com> wrote:
> Could you sent a full repro containing the source code of both scripts and the order of execution?
>
> Tomas
>
>
> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Clauson
> Sent: Monday, February 18, 2008 8:17 PM
> To: ironruby-core at rubyforge.org
> Subject: [Ironruby-core] Can't run script after engine exception
>
> Hi All,
>
> I've got a problem where if I execute a Ruby script that has a syntax
> error or missing method and that correctly fails I cannot use that
> engine object to subsequently execute a valid script. If I restart the
> application and re-execute the corrected script it works. It's only
> executing an erroneous script and then a valid script that fails.
>
> The code I'm using to run the script is:
>
> IScriptEnvironment scriptEnvironment = IronRuby.CreateRuntime();
> IScriptEngine rubyengine = IronRuby.GetEngine(scriptEnvironment);
> SourceUnit scriptSource =
> rubyengine.CreateScriptSourceFromString(myScript);
> IScriptScope scope = rubyengine.CreateScope();
> rubyengine.Execute(scope, scriptSource);
>
> Does anyone know if there is anyway to re-initialise the Ruby engine
> after a syntax or methodmissing exception so scripts can be executed
> again without needing to restart the application?
>
> Regards,
>
> Aaron
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>



-- 
Michael Letterle
[Polymath Programmer]
http://michaeldotnet.blogspot.com


More information about the Ironruby-core mailing list