Permalink
Browse files

Recognizer: Fix leaking options between recognizer instances

We need to copy the options object into a new object upon instantiation

Fixes #813
Closes #816
  • Loading branch information...
Christian Meixner authored and arschmitz committed Jun 25, 2015
1 parent 5fc4e8d commit af32c9bace3f04bb34bee852ff56a33cc8fc27cd
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/recognizer.js
View
@@ -40,10 +40,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);

0 comments on commit af32c9b

Please sign in to comment.