From 72b9e3525030db6ee46e50c483569174e6f8216d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=98=E6=9D=B0?= Date: Tue, 28 Mar 2017 10:18:06 +0800 Subject: [PATCH 1/3] fix: fix the deprecated warnings --- src/InjectedScriptHost.cc | 2 +- src/debug.cc | 8 ++++---- v8-debug.js | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) 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/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) { From 75098bb52a3f828ccf40537726cd3096ebc73078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=98=E6=9D=B0?= Date: Tue, 28 Mar 2017 11:20:03 +0800 Subject: [PATCH 2/3] fix: test suite --- test/v8-debug.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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'); + }); }); }); }); From a170d44a2ccd9502fb7634817bae89fda973e69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=98=E6=9D=B0?= Date: Tue, 28 Mar 2017 11:21:52 +0800 Subject: [PATCH 3/3] feat: add node 7 --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) 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