-
Notifications
You must be signed in to change notification settings - Fork 182
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
Improve compatibility with Node.js v6.0.0 #104
Conversation
Weird I wouldn't expect those tests to fail just because of that change. I'll have to look into this unless you have any ideas what caused that. |
@thoop I don't know why either. I ran |
@thoop I forgot about the case where the parameter |
`querystring` in node v6 now returns an empty object instead of `{}`, causing an error: “TypeError: parsedQuery.hasOwnProperty is not a function”. This patch should fix it.
The alternative fix is to use something like this: function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
// Then use like:
hasOwnProperty(parsedQuery, '_escaped_fragment_') which is "safer" since |
I don't think we ever want to look up the chain for |
@thoop Do you mind merging this? Please let me know if there is any other change that you'd like to see and I will be happy to tweak. |
Sorry! Been really busy this week. I'll merge it this weekend. |
Thanks for your help! |
Thank you for the merge @thoop! 👍 |
querystring
in node v6 now returns an "empty" object instead of{}
, causing an error: “TypeError: parsedQuery.hasOwnProperty is not a function”. Instead callinghasOwnProperty
onparsedQuery
, just checkparsedQuery['_escaped_fragment_']
instead, as suggested by @thoop