diff --git a/.travis.yml b/.travis.yml index 6a774c4..f7a7544 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ env: - export NODE_VERSION="4" - export NODE_VERSION="5" - export NODE_VERSION="6" + - export NODE_VERSION="7" global: - node_pre_gyp_region="eu-central-1" diff --git a/src/debug.cc b/src/debug.cc index 43482e6..e1af550 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -35,15 +35,24 @@ namespace nodex { } Local fn = Local::Cast(info[0]); - v8::Debug::Call(fn); + #if (NODE_MODULE_VERSION > 48) + Local context = fn->GetIsolate()->GetCurrentContext(); + v8::Debug::Call(context, fn); + #else + v8::Debug::Call(fn); + #endif RETURN(Undefined()); }; static NAN_METHOD(SendCommand) { String::Value command(info[0]); #if (NODE_MODULE_VERSION > 11) + #if (NODE_MODULE_VERSION > 48) + Isolate* debug_isolate = v8::Debug::GetDebugContext(Isolate::GetCurrent())->GetIsolate(); + #else Isolate* debug_isolate = v8::Debug::GetDebugContext()->GetIsolate(); + #endif v8::HandleScope debug_scope(debug_isolate); v8::Debug::SendCommand(debug_isolate, *command, command.length()); #else @@ -58,12 +67,20 @@ namespace nodex { if (expression.IsEmpty()) RETURN(Undefined()); + #if (NODE_MODULE_VERSION > 48) + Local debug_context = v8::Debug::GetDebugContext(Isolate::GetCurrent()); + #else Local debug_context = v8::Debug::GetDebugContext(); + #endif #if (NODE_MODULE_VERSION > 45) if (debug_context.IsEmpty()) { // Force-load the debug context. v8::Debug::GetMirror(info.GetIsolate()->GetCurrentContext(), info[0]); + #if (NODE_MODULE_VERSION > 48) + debug_context = v8::Debug::GetDebugContext(Isolate::GetCurrent()); + #else debug_context = v8::Debug::GetDebugContext(); + #endif } #endif diff --git a/v8-debug.js b/v8-debug.js index 0d94df8..ce8be01 100644 --- a/v8-debug.js +++ b/v8-debug.js @@ -169,7 +169,10 @@ function sendCommand(name, attributes, userdata) { command: name, arguments: attributes || {} }; - binding.sendCommand(JSON.stringify(message)); + // don't know why yet + process.nextTick(function() { + binding.sendCommand(JSON.stringify(message)) + }); }; V8Debug.prototype.commandToEvent = function(request, response) {