-
Notifications
You must be signed in to change notification settings - Fork 30k
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: Add common aliases for console methods #3486
Conversation
aks-
commented
Oct 22, 2015
- add common aliases as per following spec
- https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
@@ -48,6 +48,10 @@ is used on each argument. See [util.format()][] for more information. | |||
|
|||
Same as `console.log`. | |||
|
|||
### console.debug([data][, ...]) |
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 suggest using the same signature as in the spec: console.debug(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.
Then we might want to change the complete doc for console. Because the signature to methods like log are also not matching with spec we are following https://github.com/nodejs/node/blob/master/doc/api/console.markdown#consolelogdata- Do you think I should change them as well?
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.
Yes, I think changing the signatures to match the spec would be preferred. Can you do so in a second commit?
Please also add some tests for these methods here. |
Wouldn't this need to be |
I don't think we have to support broken polyfills or monkey patches, and I think it's unlikely anyone would do so in the case of these methods. |
Hm. on the converse side, this lets things designed for the browser run as is, even if they use these features. |
It seems low risk. If code is monkeypatching the |
b26facc
to
ae36937
Compare
@silverwind I have added the tests for this and changed the signture of newly added aliases as per browser spec. Besides that I created a new PR #3584 in which I changed the method signatures which were there previously in doc to follow the browser spec. I haven't changed the signatures of methods which have differnent behaviour in node than in browser (e.g. console.assert). Now I am in confusion if we are actually following the spec? |
@aks- thanks, I'll have a look later. This PR is LGTM. |
@aks- on second look, what's up with |
- add common aliases as per following spec - https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
ae36937
to
16641f7
Compare
@silverwind sorry I added that by accident I guess...removed it now |
LGTM, will likely land this tomorrow. |
I'm not sure this is a good idea actually if we aren't going to follow the rest of the "spec". @aks- Sorry, my fault for pulling you into this console-spec thing. :/ |
@Fishrock123 I think we should implement as much of this "spec" as is feasible. What's wrong with these alias methods? |
Nothing particularly but it's more things we need to keep supporting. Seems low-value -- stuff works fine if it follows this part but not another part kind of thing. |
@Fishrock123 it's okay, I am actually learning a lot about the structure of node codebase :) |
Guess I'll put this on hold then. Interestingly, MDN says |
See #3584 (comment), the situation is generally very silly. |
Closing due to lack of activity. Seems like there's very little interest in this in general. |