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

fix($parse): mark constant unary minus expressions as constant #6932

Closed
wants to merge 1 commit into from

Conversation

teropa
Copy link
Contributor

@teropa teropa commented Apr 1, 2014

Request Type: bug

How to reproduce: Parse an expression like -42. Check its constant flag. Expected: true. Actual: false.

Component(s): $parse

Impact: small

Complexity: small

This issue is related to:

Detailed Description:

Expressions that use the unary - operator are currently never marked as constants.

Make Parser.ZERO a constant expression function, so that unary minus
expressions that use it may be marked constant.

Other Comments:

Make Parser.ZERO a constant expression function, so that unary minus
expressions that use it may be marked constant.
@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6932)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@lgalfaso
Copy link
Contributor

lgalfaso commented Apr 1, 2014

LGTM

@lgalfaso lgalfaso removed their assignment Apr 1, 2014
@caitp
Copy link
Contributor

caitp commented Apr 2, 2014

LGTM

@caitp caitp closed this in 7914d34 Apr 2, 2014
caitp pushed a commit that referenced this pull request Apr 2, 2014
Previously, constant numbers with a unary minus sign were not treated as constants. This fix corrects
this behaviour, and may provide a small performance boost for certain applications, due to constant
watches being automatically unregistered after their first listener call.

Closes #6932
@teropa teropa deleted the fix-unary-minus-constant branch April 3, 2014 03:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants