Skip to content

fix($state) The is check on type any will always return true. #1944

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

Merged
merged 1 commit into from
May 9, 2015

Conversation

ckniffen
Copy link

@ckniffen ckniffen commented May 7, 2015

Fixes breaking change in 0.2.14 where parameters no longer were allowed to have default values of 0, false, '', or undefined.

Fixes: #1915

@@ -623,7 +623,7 @@ function $UrlMatcherFactory() {
any: { // does not encode/decode
encode: angular.identity,
decode: angular.identity,
is: angular.identity,
is: function(){ return true; },
Copy link
Contributor

Choose a reason for hiding this comment

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

a function that always returns true?

Copy link
Author

Choose a reason for hiding this comment

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

@eddiemonge The reason for this is that any.is was always returning whatever you passed in.

any.is(false) would always return false. Since everything is type any it should always return true.

@nateabele
Copy link
Contributor

Yeah, looks good. Throw in -1 for the heck of it and squash your commits. Thanks again for the patch.

Strictly speaking, the test should probably go against the spec for $urlMatcherFactory, but this is totally fine for now.

@ckniffen ckniffen force-pushed the bugfix/any-is-check branch 2 times, most recently from 4e2b221 to aa9ebe0 Compare May 8, 2015 01:05
@eddiemonge
Copy link
Contributor

You changed the commit message style so it doesnt follow angular guidelines anymore

By not specifying an `is` method the default is method for types which always returns `true` will be used.
Fixes breaking change in 0.2.14 where parameters no longer were allowed to have default values of `0`, `false`, `''`, `undefined`, or `-1`.

Fixes: angular-ui#1915
@ckniffen ckniffen force-pushed the bugfix/any-is-check branch from aa9ebe0 to ba6ed61 Compare May 8, 2015 23:38
@ckniffen
Copy link
Author

ckniffen commented May 8, 2015

@eddiemonge Sorry about that. I have updated the message.

nateabele added a commit that referenced this pull request May 9, 2015
fix($state) The `is` check on type `any` will always return true.
@nateabele nateabele merged commit eeb9c4e into angular-ui:master May 9, 2015
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.

0.2.14 Caused a breaking change
3 participants