From 9a4681d4e187eb86d9c202502a231ddb6674b827 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 27 May 2017 14:31:46 -0400 Subject: [PATCH] fix #2656 --- src/js/utils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/utils.js b/src/js/utils.js index 48a8d43d8..a8146e1b8 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -285,6 +285,9 @@ // longer needed. A timer will be used for self-garbage-collect. // Cleaning up 10s after last hit sounds reasonable. +// https://github.com/gorhill/uBlock/issues/2656 +// Can't use chained calls if we want to support legacy Map(). + µBlock.stringDeduplicater = { strings: new Map(), timer: undefined, @@ -293,7 +296,8 @@ lookup: function(s) { var t = this.strings.get(s); if ( t === undefined ) { - t = this.strings.set(s, s).get(s); + this.strings.set(s, s); + t = this.strings.get(s); if ( this.timer === undefined ) { this.cleanupAsync(); } } this.last = Date.now();