Skip to content

The memoizing stemmer breaks on the word 'constructor' - #3

Open
bwbroersma wants to merge 2 commits into
jedp:masterfrom
SlowSearch:master
Open

The memoizing stemmer breaks on the word 'constructor'#3
bwbroersma wants to merge 2 commits into
jedp:masterfrom
SlowSearch:master

Conversation

@bwbroersma

Copy link
Copy Markdown

I added a failing test case in 2f7dee2 and the fix in e86373f.
It's just replacing
var memo = {};
with
var memo = Object.create(null);

…ctor' to "Dr Porter's test", now we have a failing test case.
"An Object has a prototype, so there are default keys in the map that could collide with your keys if you're not careful. As of ES5 can be bypassed by using map = Object.create(null), but is seldom done." - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Objects_and_maps_compared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant