Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(limitTo): ignore limit when undefined - #10510

Closed
marcin-wosinek wants to merge 1 commit into
angular:masterfrom
marcin-wosinek:master
Closed

marcin-wosinek wants to merge 1 commit into
angular:masterfrom
marcin-wosinek:master

Conversation

@marcin-wosinek

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: limitTo changed behavoir when limit value is undefined.
Instead of returning empty object/array it returns non-changed input.

Closes #10484

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

Comment thread src/ng/filter/limitTo.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO, "returned" is more appropriate than "left" (since the input is left unchanged in any case).

@gkalpak

gkalpak commented Dec 18, 2014

Copy link
Copy Markdown
Member

I have left a couple of minor comments inline.

Additionally, I believe a little refactoring is in place: it would be better (i.e. more maintainable/performant) to do the NaN check sooner in the code (and return the input itself), so we can (1) "fail fast" and (2) avoid some of the else blocks further down.

But "functionality-wise" it should be OK.

BTW, the commit message and breaking change notice are slightly inaccurate: It is not only undefined but any invalid value, right ?

@marcin-wosinek

Copy link
Copy Markdown
Contributor Author

@gkalpak thanks for the review

@marcin-wosinek
marcin-wosinek force-pushed the master branch 2 times, most recently from 7d48430 to f1a6390 Compare December 18, 2014 14:36
@marcin-wosinek

Copy link
Copy Markdown
Contributor Author

I'm lost with the build result. I get:

No output has been received in the last 10 minutes, this potentially indicates 
a stalled build or something wrong with the build itself.

The build has been terminated

from job 1.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit picking: Could add a test for '0' (string) as well.

@gkalpak

gkalpak commented Dec 18, 2014

Copy link
Copy Markdown
Member

@marcin-wosinek: It is a flake (not related to the build) on SauseLabs only. I restarted the job, but since the tests passed on BrowserStack, it should be OK.

I left two "nit-picky" comments on the tests, but other than that it looks good to me.

(There's a typo in the BREAKING CHANGE notice btw: behavoir --> behavio[u]r)

@marcin-wosinek
marcin-wosinek force-pushed the master branch 2 times, most recently from d2e50bd to b66a1fe Compare December 18, 2014 18:39
@gkalpak

gkalpak commented Dec 18, 2014

Copy link
Copy Markdown
Member

LGTM

BREAKING CHANGE: limitTo changed behavior when limit value is invalid.
Instead of returning empty object/array it returns unchanged input.

Closes angular#10484
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

limitTo: Ignore limit when undefined

3 participants