1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

check to see if there was an exception compiling the script. raise it if so

This commit is contained in:
Charles Lowell 2010-01-30 21:06:55 -06:00
parent fecfe284cc
commit 627b974144

View file

@ -66,6 +66,9 @@ VALUE v8_cxt_eval(VALUE self, VALUE source) {
Context::Scope enter(cxt);
Local<Value> source_str = RB2V8(source);
Local<Script> script = Script::Compile(source_str->ToString());
if (exceptions.HasCaught()) {
return V8_Ref_Create(V8_C_Message, exceptions.Message());
}
Local<Value> result = script->Run();
if (exceptions.HasCaught()) {
return V8_Ref_Create(V8_C_Message, exceptions.Message());