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

fix($parse): Handle sign of -undefined consistently #14451

Closed
wants to merge 1 commit into from

Conversation

lgalfaso
Copy link
Contributor

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
fix

What is the current behavior? (You can also link to an open issue here)
When csp is enabled $parse('-undefined') is 0

What is the new behavior (if this is a feature change)?
When csp is enabled $parse('-undefined') is -0

Does this PR introduce a breaking change?
No, this is the way it should work, and the way it works when csp is disabled.

Please check if the PR fulfills these requirements

Other information:

When csp is disabled, evaluating -undefined is -0 and when csp is enabled
the evaluation is 0. In most cases this is not an issue as 0 === -0, but
there is an edge case as 1/0 === Infinity and 1/-0 === -Infinity

When csp is disabled, evaluating `-undefined` is `-0` and when csp is enabled
the evaluation is `0`. In most cases this is not an issue as `0 === -0`, but
there is an edge case as `1/0 === Infinity` and `1/-0 === -Infinity`
@gkalpak
Copy link
Member

gkalpak commented Apr 18, 2016

LGTM

@lgalfaso lgalfaso closed this in c1eaf34 Apr 18, 2016
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.

3 participants