-
Notifications
You must be signed in to change notification settings - Fork 211
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
TypeError: undefined is not a function in obj.hasOwnProperty(k) #290
Comments
Thanks @aaronjensen - we're looking into this today. |
|
rokob
added a commit
that referenced
this issue
May 30, 2017
Fixes #290 handle objects without Object in prototype chain
Thanks for the quick turnaround! Would you mind dropping a note here on the next release so I can upgrade and remove my workaround? Thanks |
mudetroit
pushed a commit
that referenced
this issue
Mar 14, 2024
Sometimes people use `Object.create(null)` which means that Object does not end up in the prototype chain of said created objects. This means that hasOwnProperty is not a method on that object so calling `obj.hasOwnProperty(prop)` will break. To get around this, we can use `Object.prototype.hasOwnProperty.call(obj, prop)`. As far as I can tell this is safe at least as far back as IE 6 and all version of node. It is only relevant when we don't really know how the object was constructed, so it isn't necessary to use this universally. There is a miniscule performance hit and a bit of a readability issue with it, so prefer not to use this style when we create the object ourselves.
mudetroit
pushed a commit
that referenced
this issue
Mar 14, 2024
Fixes #290 handle objects without Object in prototype chain
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
querystring objects seem to break rollbar. It may have something to do with nodejs/node#6289
This is the property that is being scrubbed that is causing the failure:
Exception:
The text was updated successfully, but these errors were encountered: