-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
console: change doc to follow major browser console doc #3584
console: change doc to follow major browser console doc #3584
Conversation
aks-
commented
Oct 29, 2015
- changed node's console doc to follow the following spec doc
- https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
@@ -72,15 +72,15 @@ object. This is useful for inspecting large complicated objects. Defaults to | |||
- `colors` - if `true`, then the output will be styled with ANSI color codes. | |||
Defaults to `false`. Colors are customizable, see below. | |||
|
|||
### console.time(timerName) | |||
### console.time(label) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to MDN history, it's called timerName
on there since 2012 when that article was created, thought calling it label
seems somewhat common too.
If we agree on calling it label
, I can change it on MDN, supposedly.
cc: @targos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silverwind I don't really care. I changed it after your suggestion.
If you want to change it back, just run git revert
8c043c1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@silverwind done.
- changed node's console doc to follow the following spec doc - https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
8215ae2
to
d48a9c3
Compare
LGTM |
@@ -32,7 +32,7 @@ In daily use, the blocking/non-blocking dichotomy is not something you | |||
should worry about unless you log huge amounts of data. | |||
|
|||
|
|||
### console.log([data][, ...]) | |||
### console.log(object [, object, ...]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first argument is optional too. You can call console.log()
to print a blank line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this before, Node and Firefox print an empty line, Chrome does not. Maybe it should be brought up with the spec authors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh, what actually matters here is what Node does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be console.log([object, ...])
, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or console.log([object [, ...]])
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in PHP doc: http://php.net/manual/en/function.printf.php
@Fishrock123 agree, this isn't correctly documenting how it currently works in node. I filed DeveloperToolsWG/console-object#36 to hopefully clarify what the expected behaviour is. |
That "spec" is a reasonable attempt but not really anything normative. I would not base anything on it. Console behaviour is not really interoperable. |
@domenic are you saying that our console shouldn't try to be similar to a browser console? |
It definitely should. But that document and browser console behavior are unrelated. And browsers don't really agree on console behavior in various ways. |
Marked as stalled. Will close if there's no new activity in the next few weeks. |
Closing due to further lack of activity. This might still be worthwhile, however, so can definitely reopen if necessary. |