Skip to content

Commit

Permalink
Merge pull request #2 from BitClock/feature
Browse files Browse the repository at this point in the history
use mock weakset until nodejs/node#6180 is fixed
  • Loading branch information
bernardmcmanus authored May 28, 2017
2 parents 1a3750f + a0b9da2 commit 04591d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/weak-set.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const { WeakSet } = global;

/**
* IMPORTANT: MockWeakSet intentionally omits unused methods (like delete)
*/
Expand All @@ -15,5 +13,7 @@ function MockWeakSet(mws = []) {
}

export default function MaybeWeakSet(iterable) {
return WeakSet ? new WeakSet(iterable) : MockWeakSet(iterable);
// WeakSet causes a horrible memory leak in node so just use the mock for now
// https://github.com/nodejs/node/issues/6180
return MockWeakSet(iterable);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bitclock",
"version": "0.2.0-beta.1",
"version": "0.2.0-beta.2",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down

0 comments on commit 04591d7

Please sign in to comment.