From 286363a2ba5ccd1cc6bfbbcffc89f659876923de Mon Sep 17 00:00:00 2001 From: Christian Meixner Date: Thu, 25 Jun 2015 11:58:12 +0200 Subject: [PATCH] fixes leaking options between recognizer instances by coping the options object into a new object upon instantiation #813 --- hammer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hammer.js b/hammer.js index 522668899..008f29d47 100644 --- a/hammer.js +++ b/hammer.js @@ -1256,10 +1256,13 @@ var STATE_FAILED = 32; * @param {Object} options */ function Recognizer(options) { + // make sure, options are copied over to a new object to prevent leaking it outside + options = extend({}, options || {}); + this.id = uniqueId(); this.manager = null; - this.options = merge(options || {}, this.defaults); + this.options = merge(options, this.defaults); // default is enable true this.options.enable = ifUndefined(this.options.enable, true);