Skip to content

Commit

Permalink
use mock weakset until nodejs/node#6180 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardmcmanus committed May 28, 2017
1 parent 1a3750f commit a0b9da2
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 a0b9da2

Please sign in to comment.