From c4685a9e3a579c253ccf8e7379c047c3a1f99106 Mon Sep 17 00:00:00 2001 From: Deema Evanov Date: Thu, 25 Sep 2014 16:28:53 +0400 Subject: [PATCH] Make `set` chainable `.set` should return self, according to the spec https://people.mozilla.org/~jorendorff/es6-draft.html#sec-weakmap.prototype.set --- weakmap.js | 1 + 1 file changed, 1 insertion(+) diff --git a/weakmap.js b/weakmap.js index 8d2155a..0540742 100644 --- a/weakmap.js +++ b/weakmap.js @@ -20,6 +20,7 @@ if (typeof WeakMap === 'undefined') { entry[1] = value; else defineProperty(key, this.name, {value: [key, value], writable: true}); + return this; }, get: function(key) { var entry;