From a0b9da2a7bbce46706fd8a33130f7c3cf043fad9 Mon Sep 17 00:00:00 2001 From: Bernard McManus Date: Sun, 28 May 2017 02:30:26 -0400 Subject: [PATCH] use mock weakset until https://github.com/nodejs/node/issues/6180 is fixed --- lib/weak-set.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/weak-set.js b/lib/weak-set.js index 1ef6b6c..6f94988 100644 --- a/lib/weak-set.js +++ b/lib/weak-set.js @@ -1,5 +1,3 @@ -const { WeakSet } = global; - /** * IMPORTANT: MockWeakSet intentionally omits unused methods (like delete) */ @@ -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); } diff --git a/package.json b/package.json index a096ee1..91241e9 100644 --- a/package.json +++ b/package.json @@ -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",