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

PropertyEffects.splice type does not allow undefined "deleteCount" parameter #5366

Closed
floribon opened this issue Oct 5, 2018 · 0 comments
Closed

Comments

@floribon
Copy link
Contributor

floribon commented Oct 5, 2018

Steps to Reproduce

Given a custom element myElem with an array property myArray, I call

myElem.splice('myArray', 0);

Expected Results

TypeScript does not complain, array is cleared, matching ES specs for Array.prototype.splice

Actual Results

TypeScript errors due to the third parameter being undefined

Versions

  • Experienced on Polymer v2.6.0
floribon added a commit to floribon/polymer that referenced this issue 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.

Fixes Polymer#5366
TimvdLippe pushed a commit that referenced this issue 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.

Fixes #5366
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

No branches or pull requests

1 participant