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

Bug where no prototypical inheritence chain exists #1110

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

NoMan2000
Copy link
Contributor

  • Some transpilers will create objects using Object.create(null). This creates an object with no prototypical inheritance, so there is no hasOwnProperty method on it.

The fix is if that if such an object exists, use Object.assign to copy the prototype chain from an empty object into the null created obj.

Otherwise, you just get a TypeError that obj.hasOwnProperty is not a function.

Signed-off-by: NoMan2000 [email protected]

@coveralls
Copy link

coveralls commented May 4, 2020

Coverage Status

Coverage increased (+0.004%) to 94.86% when pulling b4b0485 on NoMan2000:master into 699b984 on vpulim:master.

- Some transpilers will create objects using `Object.create(null)`.  This creates an object with no prototypical inheritence, so no `hasOwnProperty`.

The fix is if such an object exists, we use `Object.assign` to copy the prototype from an empty object into the obj.

Signed-off-by: NoMan2000 <[email protected]>
@ZacharyKearns
Copy link

Is anyone reviewing this? After updating to v0.31.0 this issue broke my app I had to roll back to a previous version.

@NoMan2000
Copy link
Contributor Author

The fix is dead simple, so I'm guessing that they haven't seen it?

@jsdevel jsdevel merged commit 5c3c810 into vpulim:master Jul 15, 2020
@ZacharyKearns
Copy link

This didn't fix my issue unfortunately. Any null values in the args still causes the request to fail.

@NoMan2000
Copy link
Contributor Author

NoMan2000 commented Jul 27, 2020

This didn't fix my issue unfortunately. Any null values in the args still causes the request to fail.

@ZacharyKearns

Can you submit some sample code and tag me on it?

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.

4 participants