Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make weak usage optional

Currently weak does not compile on 0.11.5. This fix allows usage of dnode on 0.11 without having to wait for weak to be fixed.
  • Loading branch information...
commit 34d1c9aa9696f13bdf8fb99d9d039367ad873f90 1 parent 6ce5c03
@Raynos Raynos authored committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 index.js
View
6 index.js
@@ -2,7 +2,7 @@ var dnode = require('./lib/dnode');
var parseArgs = require('./lib/parse_args');
var net = require('net');
var util = require('util');
-var weak = require('weak');
+var weak
exports = module.exports = function (cons, opts) {
return new D(cons, opts);
@@ -24,6 +24,10 @@ function D (cons, opts) {
if (!opts) opts = {};
if (opts.weak !== false && !opts.proto) {
+ if (!weak) {
+ weak = require("weak")
+ }
+
opts.proto = {};
opts.proto.wrap = function (cb, id) {
var proto = this;
Please sign in to comment.
Something went wrong with that request. Please try again.