Permalink
Browse files

test: use the debug build of node-weak when necessary

  • Loading branch information...
1 parent c752f6c commit 05fe70b582c1f888e09ea7d21a70fe736bd09d12 @TooTallNate TooTallNate committed Jun 14, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 test/gc/node_modules/weak/lib/weak.js
View
11 test/gc/node_modules/weak/lib/weak.js
@@ -1,4 +1,13 @@
-var bindings = require('../build/Release/weakref.node')
+var bindings
+try {
+ bindings = require('../build/Release/weakref.node')
+} catch (e) {
+ if (e.code === 'MODULE_NOT_FOUND') {
+ bindings = require('../build/Debug/weakref.node')
+ } else {
+ throw e
+ }
+}
module.exports = bindings.create
// backwards-compat with node-weakref

0 comments on commit 05fe70b

Please sign in to comment.