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:
parent
fecfe284cc
commit
627b974144
1 changed files with 3 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue