Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use mock weakset until https://github.com/nodejs/node/issues/6180 is fixed #2

Merged
merged 1 commit into from
May 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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