From 779da87017c7a26b33c9ea32a164a57386c7096f Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Wed, 11 Apr 2012 15:58:50 +1000 Subject: [PATCH] fixes for err in callback; terminate om end --- test/atoms.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/atoms.js b/test/atoms.js index 0cd4ec6..ce4d853 100644 --- a/test/atoms.js +++ b/test/atoms.js @@ -1,13 +1,11 @@ var x11 = require('../lib/x11'); - -var xclient = x11.createClient(); - -xclient.on('connect', function(display) { - var X = this; +x11.createClient(function(display) { + var X = display.client; var hello = 'Hello, node.js'; - X.InternAtom(false, hello, function(atomId) { - X.GetAtomName(atomId, function(str) { + X.InternAtom(false, hello, function(err, atomId) { + X.GetAtomName(atomId, function(err, str) { console.log('Value for atom ' + atomId + ' is \"' + str + '\"'); + X.terminate(); }); }); });