Skip to content

Commit

Permalink
Added v8::Locker to term_to_js and js_to_term
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Mar 22, 2011
1 parent 86b4029 commit 1b034a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions c_src/erlv8_term.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ v8::Handle<v8::Object> externalize_term(map<ERL_NIF_TERM, v8::Handle<v8::Object>
}

v8::Handle<v8::Value> term_to_js(v8::Handle<v8::Context> ctx, ErlNifEnv *env, ERL_NIF_TERM term) {
v8::HandleScope handle_scope;
v8::Context::Scope context_scope(ctx);
LHCS(ctx);
int _int; unsigned int _uint; long _long; unsigned long _ulong; ErlNifSInt64 _int64; ErlNifUInt64 _uint64; double _double;
ErlNifBinary string_binary;
unsigned len;
Expand Down Expand Up @@ -265,8 +264,7 @@ v8::Handle<v8::Value> term_to_js(v8::Handle<v8::Context> ctx, ErlNifEnv *env, ER


ERL_NIF_TERM js_to_term(v8::Handle<v8::Context> ctx, ErlNifEnv *env, v8::Handle<v8::Value> val) {
v8::HandleScope handle_scope;
v8::Context::Scope context_scope(ctx);
LHCS(ctx);
if (val.IsEmpty()) {
return enif_make_atom(env,"undefined");
} else if (val->IsFunction()) { // the reason why this check is so high up here is because it is also an object, so it should be before any object.
Expand Down

0 comments on commit 1b034a9

Please sign in to comment.