Skip to content

Commit

Permalink
using sys.inherits for prototypal inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
kailashnath committed May 2, 2011
1 parent a96cb58 commit 13cbffc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions isbn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var http = require('http');
var emitter = require('events').EventEmitter;
var http = require('http'),
emitter = require('events').EventEmitter,
inherits = require('sys').inherits;

var options = { host : 'isbn.net.in',
path : '/' }
Expand Down Expand Up @@ -108,7 +109,7 @@ function lookup(isbn)
}).on('error', function(e) { $.emit('error', new error(-1, e)); });
}

lookup.prototype = new emitter;
inherits(lookup, emitter);
lookup.prototype.__parse = parse;

function search(isbn)
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var isbn = require('./isbn');

isbn.lookup('142000280').on('err',
isbn.lookup('0142000280').on('err',
function(err) {
console.log("ERROR :", err);
}).on('success',
Expand Down

0 comments on commit 13cbffc

Please sign in to comment.