| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Can you use let instead of var, and a template string instead of concatenation.
Sorry, something went wrong.
|
You changed two code paths, but only added a test for one. Can you test for the other too? |
Sorry, something went wrong.
|
Thanks for the review. Code comments addressed. I don't actually know how to test the other code path. which is an error occurring while watching a file. Any suggestions? |
Sorry, something went wrong.
There was a problem hiding this comment.
This is not necessary.
Sorry, something went wrong.
There was a problem hiding this comment.
unfortunately it is. If the function doesn't return true, it throws the error.
Sorry, something went wrong.
There was a problem hiding this comment.
@charlierudolph Oops, sorry. My bad.
Sorry, something went wrong.
|
Even if it's non-standard, might be worth going with camelCased fileName for consistency with other envs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/fileName |
Sorry, something went wrong.
|
One important difference is that Error.prototype.fileName indicates the file that raised the exception, while the proposed addition in this PR indicates a parameter to a file system operation. |
Sorry, something went wrong.
|
@cjihrig bump. Anything else this PR needs? |
Sorry, something went wrong.
There was a problem hiding this comment.
This can actually be const
Sorry, something went wrong.
|
It LGTM, but I'd really like a test for the emit path. Would anyone object to a slightly artificial test like: var watcher = fs.watch(__filename); watcher._handle.onchange(-1, 'ENOENT', 'foo.js'); |
Sorry, something went wrong.
|
okay @cjihrig the emit path now has a test. |
Sorry, something went wrong.
There was a problem hiding this comment.
Instead of creating watcherErrorCaught, you can just wrap this function in common.mustCall(). That way you can ensure it was called, and fail the test if it's not.
Sorry, something went wrong.
|
One comment, but this LGTM |
Sorry, something went wrong.
|
Oh, and can you squash this down to a single commit? |
Sorry, something went wrong.
|
Switched to using common.mustCall and squashed to a single commit. |
Sorry, something went wrong.
Sorry, something went wrong.
|
That build is very complex to traverse. Okay from the link provided I got to The build page shows another commit is being tested in addition to mine. |
Sorry, something went wrong.
|
Don't worry about that test. It fails often. |
Sorry, something went wrong.
This commit adds the relevant filename to fs.watch() errors. Refs: nodejs/node-v0.x-archive#25542 PR-URL: #2748 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
Brought over from nodejs/node-v0.x-archive#25542