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

Update jsdoc for PropertyEffects.splice #5367

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

floribon
Copy link
Contributor

@floribon floribon commented Oct 5, 2018

Array.prototype.splice has its "deleteCount" parameter optional. When omitted, all
items of the arrays are removed. This works with a polymer element
"splice" method, but the typing does not correspond and TypeScript
prevents it.


Please let me know if I should:

  • extend the jsdoc definition of the deleteCount param to specify that
    when omitted all items are removed (I assumed that the comment "The
    arguments after path and return value match that of "Array.prototype.slice" was enough)

  • add a test for the case elem.splice('array', 0). I assumed that this
    may end up testing the Array API and not useful

  • make the same change for the 2.x branch and/or anywhere else

Reference Issue

Fixes #5366

Array.prototype.splice has its "deleteCount" parameter optional. When omitted, all
items of the arrays are removed. This works with a polymer element
"splice" method, but the typing does not correspond and TypeScript
prevents it.

Fixes Polymer#5366
Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

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

The tests were added in #5051, so I think that is still okay. Given that the docs already mention it has the same semantics as Array.prototype.splice, I think that is fine as well.

Feel free to backport to 2.x if necessary.

@TimvdLippe TimvdLippe merged commit 96557f7 into Polymer:master Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants