-
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
assert: refactor to avoid unsafe array iteration #37344
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Benchmark CI showed a few improvements and no significant perf regressions:
|
@@ -313,6 +313,17 @@ function createErrDiff(actual, expected, operator) { | |||
return `${msg}${skipped ? skippedMsg : ''}\n${res}${other}${end}${indicator}`; | |||
} | |||
|
|||
function addEllipsis(string) { | |||
const lines = StringPrototypeSplit(string, '\n', 11); |
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.
@aduh95 Thanks for fixing the bug. Why did we add 11
here?
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.
We only want to keep the first 10 lines, we can give up splitting the string at the 11th line.
PR-URL: nodejs#37344 Reviewed-By: Darshan Sen <[email protected]>
bbde06d
to
9a10578
Compare
Landed in 9a10578 |
PR-URL: #37344 Reviewed-By: Darshan Sen <[email protected]>
PR-URL: #37344 Reviewed-By: Darshan Sen <[email protected]>
PR-URL: #37344 Reviewed-By: Darshan Sen <[email protected]>
PR-URL: #37344 Reviewed-By: Darshan Sen <[email protected]>
PR-URL: #37344 Reviewed-By: Darshan Sen <[email protected]>
No description provided.