-
Notifications
You must be signed in to change notification settings - Fork 126
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
Prefix keys in seqObj's seenKeys to avoid collisions #235
Conversation
Otherwise, seqObj will fail for the keys in `Object.getOwnPropertyNames(Object.prototype)`, the most likely collision being "constructor". An alternate implementation strategy is `Object.create(null)`, but it's not supported on IE <9, and is not possible to polyfill.
good catch, thanks. and appreciate the eye for ie compat! |
3 similar comments
wow idk what's going on with coveralls there lol. i'll merge this and release when i get some free time. |
This solution should be good for 99% of cases but I think it would be more correct to use hasOwnProperty goes back to ES3 so it should work in all environments Parsimmon supports. Also, would you mind fixing this in |
Thanks for the bugfixes! |
Otherwise, seqObj will fail for the keys in
Object.getOwnPropertyNames(Object.prototype)
, the most likely collision being "constructor".An alternate implementation strategy is
Object.create(null)
, but it's not supported on IE <9, and is not possible to polyfill.