Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Fix of a bug that happens when the user defines prototype functions for Array #729

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andreyyudin
Copy link

Fix of an issue of having prototype Array function definitions. In this case the original code would go through all those functions and treat them as parameters, rather than working only on the actual content of an array. For example, having
Array.prototype.last = function(){...

defined would result in one of the elements of sharedParameters to represent that function, which in turn would lead to a problem on line 329 since for such a parameter, param.schema would be undefined.
Also, a couple of small cosmetic adjustments of the code.

…is case the original code would go through all those functions and treat them as parameters, rather than working only on the actual content of an array. For example, having Array.prototype.last = function(){... defined would result in one of the elements of sharedParameters to represent that function, which in turn would lead to a problem on line 329 since for such a parameter, param.schema would be undefined
Copy link

@victorcmoura victorcmoura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, well pointed. However, in my opinion, there could be a single line comment explaining why the old school for loop should not be replaced by for i in object, it would prevent future contributors from rolling back your improvement in case the reviewer is not aware of this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants