diff --git a/appveyor.yml b/appveyor.yml index eb3ce33..11ae3e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,10 @@ environment: secure: jJxKoyWputzRz2EjAT9i/vBzYt2+lcjKZ5D6O5TBaS9+anpYHn2XWbOut5dkOgh0 node_pre_gyp_region: eu-central-1 matrix: + - NODE_VERSION: 7 + platform: x64 + - NODE_VERSION: 7 + platform: x86 - NODE_VERSION: 6 platform: x64 - NODE_VERSION: 6 diff --git a/src/InjectedScriptHost.cc b/src/InjectedScriptHost.cc index 82839ef..561f987 100644 --- a/src/InjectedScriptHost.cc +++ b/src/InjectedScriptHost.cc @@ -170,7 +170,7 @@ namespace nodex { Local constructorSymbol = CHK(New("constructor")); if (object->HasRealNamedProperty(constructorSymbol) && !object->HasRealNamedCallbackProperty(constructorSymbol)) { TryCatch tryCatch; - Local constructor = object->GetRealNamedProperty(constructorSymbol); + Local constructor = Nan::GetRealNamedProperty(object, constructorSymbol).ToLocalChecked(); if (!constructor.IsEmpty() && constructor->IsFunction()) { Local constructorName = functionDisplayName(Handle::Cast(constructor)); if (!constructorName.IsEmpty() && !tryCatch.HasCaught()) diff --git a/src/debug.cc b/src/debug.cc index e1af550..d75e227 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -36,7 +36,7 @@ namespace nodex { Local fn = Local::Cast(info[0]); - #if (NODE_MODULE_VERSION > 48) + #if (NODE_MODULE_VERSION > 47) Local context = fn->GetIsolate()->GetCurrentContext(); v8::Debug::Call(context, fn); #else @@ -48,7 +48,7 @@ namespace nodex { static NAN_METHOD(SendCommand) { String::Value command(info[0]); #if (NODE_MODULE_VERSION > 11) - #if (NODE_MODULE_VERSION > 48) + #if (NODE_MODULE_VERSION > 47) Isolate* debug_isolate = v8::Debug::GetDebugContext(Isolate::GetCurrent())->GetIsolate(); #else Isolate* debug_isolate = v8::Debug::GetDebugContext()->GetIsolate(); @@ -67,7 +67,7 @@ namespace nodex { if (expression.IsEmpty()) RETURN(Undefined()); - #if (NODE_MODULE_VERSION > 48) + #if (NODE_MODULE_VERSION > 47) Local debug_context = v8::Debug::GetDebugContext(Isolate::GetCurrent()); #else Local debug_context = v8::Debug::GetDebugContext(); @@ -76,7 +76,7 @@ namespace nodex { if (debug_context.IsEmpty()) { // Force-load the debug context. v8::Debug::GetMirror(info.GetIsolate()->GetCurrentContext(), info[0]); - #if (NODE_MODULE_VERSION > 48) + #if (NODE_MODULE_VERSION > 47) debug_context = v8::Debug::GetDebugContext(Isolate::GetCurrent()); #else debug_context = v8::Debug::GetDebugContext(); diff --git a/test/v8-debug.js b/test/v8-debug.js index 86671f6..d292f81 100644 --- a/test/v8-debug.js +++ b/test/v8-debug.js @@ -44,7 +44,9 @@ describe('v8-debug', function() { expect(v8debug.registerAgentCommand.bind(v8debug, 'command', [], function() { done(); })).to.not.throw(); - v8debug.sendCommand('command'); + process.nextTick(function() { + v8debug.sendCommand('command'); + }); }); } else { it('enableWebkitProtocol should throw error', function() { @@ -56,7 +58,9 @@ describe('v8-debug', function() { describe('events.', function() { it('Emits `close` on disconnect command', function(done) { v8debug.on('close', done); - v8debug.sendCommand('disconnect'); + process.nextTick(function() { + v8debug.sendCommand('disconnect'); + }); }); }); }); diff --git a/v8-debug.js b/v8-debug.js index ce8be01..0d94df8 100644 --- a/v8-debug.js +++ b/v8-debug.js @@ -169,10 +169,7 @@ function sendCommand(name, attributes, userdata) { command: name, arguments: attributes || {} }; - // don't know why yet - process.nextTick(function() { - binding.sendCommand(JSON.stringify(message)) - }); + binding.sendCommand(JSON.stringify(message)); }; V8Debug.prototype.commandToEvent = function(request, response) {