Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the deprecated warnings #40

Merged
merged 3 commits into from
Mar 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/InjectedScriptHost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace nodex {
Local<String> constructorSymbol = CHK(New("constructor"));
if (object->HasRealNamedProperty(constructorSymbol) && !object->HasRealNamedCallbackProperty(constructorSymbol)) {
TryCatch tryCatch;
Local<Value> constructor = object->GetRealNamedProperty(constructorSymbol);
Local<Value> constructor = Nan::GetRealNamedProperty(object, constructorSymbol).ToLocalChecked();
if (!constructor.IsEmpty() && constructor->IsFunction()) {
Local<String> constructorName = functionDisplayName(Handle<Function>::Cast(constructor));
if (!constructorName.IsEmpty() && !tryCatch.HasCaught())
Expand Down
8 changes: 4 additions & 4 deletions src/debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace nodex {

Local<Function> fn = Local<Function>::Cast(info[0]);

#if (NODE_MODULE_VERSION > 48)
#if (NODE_MODULE_VERSION > 47)
Local<Context> context = fn->GetIsolate()->GetCurrentContext();
v8::Debug::Call(context, fn);
#else
Expand All @@ -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();
Expand All @@ -67,7 +67,7 @@ namespace nodex {
if (expression.IsEmpty())
RETURN(Undefined());

#if (NODE_MODULE_VERSION > 48)
#if (NODE_MODULE_VERSION > 47)
Local<Context> debug_context = v8::Debug::GetDebugContext(Isolate::GetCurrent());
#else
Local<Context> debug_context = v8::Debug::GetDebugContext();
Expand All @@ -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();
Expand Down
8 changes: 6 additions & 2 deletions test/v8-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node(>=7.4.0 ) needs this, can't figure it out why.

v8debug.sendCommand('command');
});
});
} else {
it('enableWebkitProtocol should throw error', function() {
Expand All @@ -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');
});
});
});
});
5 changes: 1 addition & 4 deletions v8-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down