Skip to content

Commit

Permalink
support node 0.4.12
Browse files Browse the repository at this point in the history
  • Loading branch information
defunctzombie committed Jan 12, 2012
1 parent 99c13b1 commit 81f675d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// js acts as a wrapper to the c++ bindings
// prefer to do error handling and other abstrctions in the
// js layer and only go to c++ when we need to hit libxml
var bindings = require('./build/Release/libxmljs');
var bindings = require('./lib/bindings');

// document parsing for backwards compat
var Document = require('./lib/document');
Expand Down
7 changes: 7 additions & 0 deletions lib/bindings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
try {
// node 0.6+
module.exports = require('../build/Release/libxmljs');
} catch (e) {
// node 0.4.x
module.exports = require('../build/default/libxmljs');
}
2 changes: 1 addition & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var bindings = require('../build/Release/libxmljs');
var bindings = require('./bindings');

var Element = require('./element');

Expand Down
2 changes: 1 addition & 1 deletion lib/element.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var bindings = require('../build/Release/libxmljs');
var bindings = require('./bindings');

var Document = require('./document');

Expand Down
2 changes: 1 addition & 1 deletion lib/sax_parser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var events = require('events');
var util = require('util');

var bindings = require('../build/Release/libxmljs');
var bindings = require('./bindings');

var SaxParser = function(callbacks) {
var parser = new bindings.SaxParser();
Expand Down

0 comments on commit 81f675d

Please sign in to comment.