| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
First letter should be capitalized.
Sorry, something went wrong.
|
Are there any API changes? (seeing that the tests were modified) |
Sorry, something went wrong.
|
@silverwind I'm not sure if this counts as an API change, but as discussed here, if a user passes in an object where the dir property is null or undefined, these changes make it so that the function returns the correct value instead of incorrectly throwing. |
Sorry, something went wrong.
|
I'm keen on getting the benchmark in (benchmarks/fs/) as well – but we haven't started using benchmark.js just quite yet. If you're keen, rewriting it slightly would be nice. |
Sorry, something went wrong.
|
@jbergstroem It looks like each path method would require it's own benchmark file. That's going to be a fair number of files so perhaps they should go in a new benchmark/path directory? |
Sorry, something went wrong.
|
Looks like #1752 conflicts with this. I will remove the path.win32 part from #1752 once this gets merged. Btw,
Is also valid for this PR. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
Why using slice instead of substr/substring for strings? |
Sorry, something went wrong.
|
@ChALkeR I haven't changed any code to use slice instead of substr/substring. If you're specifically referring to this line, yes I could have changed slice to substr, but instead I changed the input value to make the code cleaner and easier to read. |
Sorry, something went wrong.
|
@jbergstroem I added some benchmarks. Do those look about right? |
Sorry, something went wrong.
|
@woollybogger apologies for the late reply. LGTM. CI here: https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/827/ |
Sorry, something went wrong.
|
@jbergstroem A couple unrelated (and possibly flaky) tests failed. Does that matter? |
Sorry, something went wrong.
|
@woollybogger no, that's something we're working on improving. I can't access the old results -- can you rebase on top of latest master so we can get a new run going? You might want to see if anyone else wants to review before I/someone else look at landing it. @ChALkeR? |
Sorry, something went wrong.
|
Rebased |
Sorry, something went wrong.
Sorry, something went wrong.
|
(never mind the windows timeouts) |
Sorry, something went wrong.
|
The main part (lib/path.js) LGTM. Minor thing: you replace single-char .substr() and .charAt() with [] in all places of path module, but this one: posix.isAbsolute = function(path) {
assertPath(path);
return path.charAt(0) === '/';
};Could you fix that for consistency? |
Sorry, something went wrong.
There was a problem hiding this comment.
I am not sure if returning the original array and a new array based on conditions is a good idea.
Sorry, something went wrong.
There was a problem hiding this comment.
It's just a little helper function. There's no point in making a copy of an array when the original is all you need.
Sorry, something went wrong.
|
bump 🚅 |
Sorry, something went wrong.
There was a problem hiding this comment.
Could use shorthand properties here:
return {
device,
isUnc,
isAbsolute: isUnc || !!result[2], // UNC paths are always absolute
tail: result[3]
};
Sorry, something went wrong.
|
LGTM, few nits and a question above. |
Sorry, something went wrong.
Improve performance by: + Not leaking the `arguments` object! + Getting the last character of a string by index, instead of with `.substr()` or `.slice()` Improve code consistency by: + Using `[]` instead of `.charAt()` where possible + Using a function declaration instead of a var declaration + Using `.slice()` with clearer arguments + Checking if `dir` is truthy in `win32.format` (added tests for this) Improve both by: + Making the reusable `trimArray()` function + Standardizing getting certain path statistics with the new `win32StatPath()` function
Path functions being benchmarked are: * format * isAbsolute * join * normalize * relative * resolve
|
Updated |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
Improve performance by: + Not leaking the `arguments` object! + Getting the last character of a string by index, instead of with `.substr()` or `.slice()` Improve code consistency by: + Using `[]` instead of `.charAt()` where possible + Using a function declaration instead of a var declaration + Using `.slice()` with clearer arguments + Checking if `dir` is truthy in `win32.format` (added tests for this) Improve both by: + Making the reusable `trimArray()` function + Standardizing getting certain path statistics with the new `win32StatPath()` function PR-URL: #1778 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Path functions being benchmarked are: * format * isAbsolute * join * normalize * relative * resolve PR-URL: #1778 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Sorry, something went wrong.
Improve performance by: + Not leaking the `arguments` object! + Getting the last character of a string by index, instead of with `.substr()` or `.slice()` Improve code consistency by: + Using `[]` instead of `.charAt()` where possible + Using a function declaration instead of a var declaration + Using `.slice()` with clearer arguments + Checking if `dir` is truthy in `win32.format` (added tests for this) Improve both by: + Making the reusable `trimArray()` function + Standardizing getting certain path statistics with the new `win32StatPath()` function PR-URL: nodejs#1778 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
Path functions being benchmarked are: * format * isAbsolute * join * normalize * relative * resolve PR-URL: nodejs#1778 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
| Back | FazBrowse Home | New Git URL |
Convergence PR prompted by #35
Original PR: nodejs/node-v0.x-archive#9289
Original PR message (slightly modified):
Improve performance by:
Improve code consistency by:
Improve both by:
Benchmarks: (higher is better)
Benchmark code (gist)