path: refactor path.format() repeated code#5673
Conversation
lib/path.js
Outdated
There was a problem hiding this comment.
I think the function name will be lost in stack traces with the arrow function?
There was a problem hiding this comment.
Ah, then...will go back to the declaration style used in the rest of the object...
...and done!
lib/path.js
Outdated
There was a problem hiding this comment.
nit: missing function name here also
|
Minor fixup pushed. New CI: https://ci.nodejs.org/job/node-test-pull-request/1908/ |
|
LGTM, nice. |
|
nit: wouldn't it make more sense to use |
lib/path.js
Outdated
There was a problem hiding this comment.
Maybe keep the throws directly in path.format for better stack traces?
That would also avoid polymorphism in _format
There was a problem hiding this comment.
+1 ... moving the throw up would be best.
There was a problem hiding this comment.
Oh, good points about the stack trace and polymorphism as well. Rebased against master, changed according to these comments, and force pushed.
|
LGTM with a couple nits |
8627d44 to
bc36ea2
Compare
I had the same thought but went with the string literals because |
|
LGTM |
PR-URL: nodejs#5673 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
|
Landed in 9de9a08 |
PR-URL: #5673 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Conflicts: lib/path.js
|
This is blocked by other path changes /cc @nodejs/lts |
make -j8 test(UNIX) orvcbuild test nosign(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
Affected core subsystem(s)
path
Description of change
Refactor repeated code into a separate function.