Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with get #3

Open
jmarroyave opened this issue Mar 15, 2019 · 4 comments
Open

Problem with get #3

jmarroyave opened this issue Mar 15, 2019 · 4 comments

Comments

@jmarroyave
Copy link

Hi Josh i am using the trie-search and found a bug in it when using reserved words as a key, after debugging i found out that the problem was in the function

this.getCache.get(phrase)

when phrase = 'constructor' it returns a function() instead of an element or array, hope it clear enough to let you find out which the problem is.

Thanks in advance

@tunnckoCore
Copy link

tunnckoCore commented Jan 16, 2020

Yup. Easiest fix is updating L16 to this._map = Object.create(null); this way later when you are accessing this._map[key] (in lot of places) you won't have problems such as with constructor.

/cc @joshjung

Great library!

@joshjung
Copy link
Owner

@tunnckoCore or @jmarroyave I'm rather busy with other projects at the moment. If you make a PR for this I'll make sure to do a new release!

@tunnckoCore
Copy link

@joshjung cool, thanks. I can do it in coming days.

@7iomka
Copy link

7iomka commented Nov 15, 2023

;)

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

No branches or pull requests

4 participants