-
Notifications
You must be signed in to change notification settings - Fork 23
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
Clarify the return values of the methods #30
Comments
+1. I use console.log() in conditional breakpoints and rely on the fact that return value is undefined. sounds good to clarify that. |
I am not personally exited by this idea. Newcomers in the JS world may wonder why That's just my two cents. Florent |
@fflorent why would this impact what anyone sees or how would it impact newcomers? Example? I'm not understanding somehow. |
The fact is that if we return Firebug used not to print And I fear that printing That's the reason why I said I was not "existed" about this idea (though not against). What would be neat would be to get the reaction of a newcomer when they notice the undefined value being printed (and how "strong" is their reaction to this). (hope that's clearer) Florent |
@fflorent in JavaScript, functions must have return values even if that is undefined and the way the console works is to evaluate and return/print the result - it seems to me the issue you have is with the devtools doing both, not that there -is- a return value. I dont see a better option as if it returns something arbitrary like "OMGTHISISARBITRARY!@#!@$" that would print too.... Any return value would be printed by devtools, right? Other than special-casing something that only does console.log in the devtools to not also print the result of evaluating, I'm not really sure what else you could do? Either way, it doesnt seem like the domain of the console api to me? |
I was among those who argued in favor of displaying the return value of undefined in the Firefox devtools, because I believe it educates more than it might confuse. console.log() should be no more magic in my view than, say, window.alert(). We should restrict any magic behavior to console helper functions that are part of the tool and not part of the web. |
Over in IE and Visual Studio land we try to ensure that console.* always returns UI wise we're always debating about to show or not show But, I do think that the high order bit is to be consistent with what is returned to the page. UI wise tools should decided what's best for them but the experience from code on the page should be consistent. |
Note that the main point I opened this issue was to say that it should be stated that the Whether or not the return value is displayed within the tools may not be part of this project. (FWIW I agree with @past that the return value should be displayed for the same reason.) |
Yes, I know that pretty well ^^.
True in retrospection. Sorry for having deviated the debate. We're discussing about what should return an API and not what/how it should display the logs through the command line. Anyway, I tend to agree it should return Florent |
@fflorent yeah, sorry I wasn't intending to imply you didn't know that (I know you do) - I was just pointing it out so as to highlight the issue isn't likely in the return but in the tool. |
No worry :). Florent |
There was a question on Stack Overflow regarding the return value of the
console.log()
function within Firebug. This is obviously unintended and will be changed in issue 7774 to returnundefined
.It should be clarified that the
console
object methods are not expected to have any return value.Sebastian
The text was updated successfully, but these errors were encountered: