Skip to content

Commit

Permalink
avoid ReferenceError when using fallback for ES6 Map
Browse files Browse the repository at this point in the history
  • Loading branch information
Krinkle committed Feb 14, 2022
1 parent 7563581 commit 797994f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fuzzysort.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@

// This stuff is outside fuzzysortNew, because it's shared with instances of fuzzysort.new()
var isNode = typeof require !== 'undefined' && typeof window === 'undefined'
var MyMap = Map||function(){var s=Object.create(null);this.get=function(k){return s[k]};this.set=function(k,val){s[k]=val;return this};this.clear=function(){s=Object.create(null)}}
var MyMap = typeof Map === 'function' ? Map : function(){var s=Object.create(null);this.get=function(k){return s[k]};this.set=function(k,val){s[k]=val;return this};this.clear=function(){s=Object.create(null)}}
var preparedCache = new MyMap()
var preparedSearchCache = new MyMap()
var noResults = []; noResults.total = 0
Expand Down

0 comments on commit 797994f

Please sign in to comment.