Skip to content

Replaced abuse of the logical or operator#26

Merged
avp merged 3 commits into
avp:masterfrom
Azeirah:master
Jun 3, 2016
Merged

Replaced abuse of the logical or operator#26
avp merged 3 commits into
avp:masterfrom
Azeirah:master

Conversation

@Azeirah

@Azeirah Azeirah commented Jun 3, 2016

Copy link
Copy Markdown
Contributor

Statements like

function someFunc(x) {
    x = x || 1;
    return x;
}

Can fail unexpectedly, as for example 0 is falsy, someFunc(0) returns 1.

I was playing around with spectra, diminishing alpha values over time.. When alpha reached 0, alpha was suddenly 1, fully opaque!

var c = Spectra({r: 0, g: 0, b: 0, a: 0}).rgbaString()

Should be rgba(0, 0, 0, 0), but is rgba(0, 0, 0, 1) instead!

This has been fixed in this pull request.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 99.259% when pulling bf449ca on Azeirah:master into 13fa41d on avp:master.

@avp
avp merged commit c124f8f into avp:master Jun 3, 2016
@Azeirah

Azeirah commented Jun 4, 2016

Copy link
Copy Markdown
Contributor Author

Thanks for taking the time to merging this request, not all package maintainers take the time to manage their projects after development has stalled.

@avp avp removed the in progress label Jun 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants