Skip to content
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

csp.CLOSED shouldn't be null #3

Open
getify opened this issue Sep 17, 2014 · 2 comments
Open

csp.CLOSED shouldn't be null #3

getify opened this issue Sep 17, 2014 · 2 comments

Comments

@getify
Copy link

getify commented Sep 17, 2014

Right now the value is null, but it seems like this is a troublesome value for false positives. I could quite easily think about sending a null value through the channel, but the receiving side might errantly consider that a close signal.

I think csp.CLOSED should be an empty { } object. That way val === csp.CLOSED type checks would be protected from such false positives.

It wouldn't be a falsy value anymore, which could possibly be surprising to some. Thus, if (!val) .. checks would "break", but as mentioned, I think those checks are inherently flawed already because of the false positives issue. Indeed, in your documentation, you already acknowledge that === csp.CLOSED checks are more appropriate anyway.

@jlongster
Copy link
Owner

Yeah, I think you're right. I actually had changed that but I switched it back for some reason (it was stupid, I think I lost that git commit or something). I hate how verbose it is though. But I'm not sure we can let people do the if check like that, as those kind of things are where many bugs in JS code lie... I'll change it.

jlongster pushed a commit that referenced this issue Oct 13, 2014
always return channel from go block
@bioball
Copy link

bioball commented Jan 25, 2015

+1

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

No branches or pull requests

3 participants