-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Add methods to console as per spec #3473
Conversation
aks-
commented
Oct 21, 2015
- added noop implementions of methods required as per below spec
- added aliases for common console methods
- https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
Related: #1799 (comment) |
Console.prototype.timelineEnd = function() {}; | ||
|
||
|
||
Console.prototype.timeStamp = function() {}; |
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.
Perhaps we can define a noop
function once in the file, and then assign them all to it.
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.
+1 on defining a single noop
function.
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.
+1 to that too
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.
aha, changed the assignments to noop
cfa5c51
to
51b8ef9
Compare
@aks- ... probably the next thing I'd say is that a note should be added to the docs that these are noops and while they are defined, they are not expected to actually do anything. |
@jasnell Hmm +1. I will add them tomorrow the first thing |
- this conforms to the following spec - https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
- add common aliases as per following spec - https://github.com/DeveloperToolsWG/console-object/blob/master/api.md
51b8ef9
to
23cba06
Compare
This should probably be semver-major because it's going to break polyfills that do feature detection, e.g. if (!console.profile) polyfill(); Stubbing methods is also something of a questionable practice IMO. If you're not supporting something, don't implement it. -1 from me although I don't feel really strongly about it. |
Strong -1 here, this would break feature detection as Ben mentions. We have #1799 which takes care of the group* methods, which I plan to land eventually. A noop isn't helping here, and these methods should be taken a look on a case-by-case basis, if something isn't feasable to do in a terminal, we should just throw imho. |
@silverwind If we aren't going to follow the console spec there is no reason to land features like |
@Fishrock123 I'm pretty sure the spec does not dictate to "implement" a noop. I'd certainly prefer to have unimplented stuff as |
Also -1 for adding a bunch of noops. Seems like it would be confusing for users to call functions and have nothing happen. |
-1 from me. |
I think we'd be fine with this PR if it's reduced to just adding the aliases. |
I have made a PR doing just that then #3486 And we can discuss it there. |
@silverwind If this doesn't mean implement no-ops, I don't know what it does mean? See the top of https://github.com/DeveloperToolsWG/console-object/blob/master/api.md |
And the message of the commit that introduced this sentence doesn't help much: |
cc @bkardell who appears to have written it. |
I don't think it means doing a noop, but aliasing to |
@silverwind not everything logs there, though. I.e. What should |
Also the signature in our doc doesn't follow the the signature given in console spec. We also have to change that? |
Given the -1's, the lack of activity, and precedence on similar PRs, closing this one. |