-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
console: sub-millisecond accuracy for console.time #3166
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This makes the output of console.timeEnd in line with major browsers. PR-URL: #3166 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,8 +68,8 @@ assert.notEqual(-1, strings.shift().indexOf('foo: [Object]')); | |
| assert.equal(-1, strings.shift().indexOf('baz')); | ||
| assert.equal('Trace: This is a {"formatted":"trace"} 10 foo', | ||
| strings.shift().split('\n').shift()); | ||
| assert.ok(/^label: \d+ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^__proto__: \d+ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^constructor: \d+ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^hasOwnProperty: \d+ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^label: \d+\.\d{3}ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^__proto__: \d+\.\d{3}ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^constructor: \d+\.\d{3}ms$/.test(strings.shift().trim())); | ||
| assert.ok(/^hasOwnProperty: \d+\.\d{3}ms$/.test(strings.shift().trim())); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we consider the output of the console functions to be part of the API, the I think one could view this as semver-major. The change to thses tests demonstrates how downstream apps output parsing will break.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I don't know what is the policy about console output.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to say semver-minor for changes to console output but it's never as clear cut as it appears. For this, I personally feel it's small enough of a change that
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The probability of this breaking anything is near zero. Still, there seems to be no reason for pulling this into 4.x branch. |
||
| assert.equal(strings.length, 0); | ||
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.
Why this change is necessary?
Edit: Ah, I see it now. That is kind of the point of this PR
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.
Bikeshedding: this belongs to the first commit «console: sub-millisecond accuracy for console.time», not to «doc: reword description of console.time».
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 moved this change to the first commit