| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
+1 for feature, but needs docs and tests across all child_process APIs that support maxBuffer. Doesn't have to test that the behaviour is unlimited, but should test that it doesn't abort or throw arg typerrors. |
Sorry, something went wrong.
There was a problem hiding this comment.
Perhaps include a fail test for -Infinity
Sorry, something went wrong.
There was a problem hiding this comment.
Hm, I'm not sure that JavaScript Infinity will convert to C++ properly here.
Sorry, something went wrong.
There was a problem hiding this comment.
OK, so JavaScript Infinity translates to std::numeric_limits<double>::infinity() in C++. So, I changed max_buffer_ to a double.
Sorry, something went wrong.
|
For consistency, we should probably add the same conditionals to the async counterparts. |
Sorry, something went wrong.
There was a problem hiding this comment.
Error message needs to be updated to reflect the new constraint (It now accepts any positive number, not just unsigned integer).
Sorry, something went wrong.
There was a problem hiding this comment.
That's a good point. The integer check is still required otherwise we'll have nonsense things like 0.1 accepted as the maxBuffer. The check should likely be something like:
if ((Number.isInteger(options.maxBuffer) || options.maxBuffer === Infinity) &&
options.maxBuffer >= 0) {
...
}
And the error message should certainly be updated but that would upgrade this to a semver-major change
Sorry, something went wrong.
There was a problem hiding this comment.
0.1 is technically fine as a maxBuffer value, even if it is a bit weird. We're just going to be doing comparisons against the value to see if we surpass it.
And the error message should certainly be updated but that would upgrade this to a semver-major change
This builds on an existing semver major change, so this is going to be semver major regardless.
Sorry, something went wrong.
There was a problem hiding this comment.
That's a good point. The integer check is still required otherwise we'll have nonsense things like 0.1 accepted as the maxBuffer. The check should likely be something like:
if ((Number.isInteger(options.maxBuffer) || options.maxBuffer === Infinity) &&
options.maxBuffer >= 0) {
...
}
And the error message should certainly be updated but that would upgrade this to a semver-major change
Sorry, something went wrong.
|
Instead of "non-negative", can we use "positive"? |
Sorry, something went wrong.
|
But zero is an allowed, non-positive value. |
Sorry, something went wrong.
|
It depends on which zero you're talking about ;-) |
Sorry, something went wrong.
|
Ha. Ok, I'll make it just "positive" |
Sorry, something went wrong.
Sorry, something went wrong.
|
Another CI run because Windows: https://ci.nodejs.org/job/node-test-pull-request/5891/ |
Sorry, something went wrong.
|
Another CI run: https://ci.nodejs.org/job/node-test-pull-request/5911/ |
Sorry, something went wrong.
Fixes: nodejs#10767 PR-URL: nodejs#10769 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit refactors test-child-process-spawnsync-maxbuf.js, and adds testing for the case where maxBuffer is Infinity. PR-URL: nodejs#10769 Reviewed-By: James M Snell <jasnell@gmail.com>
Fixes: nodejs#10767 PR-URL: nodejs#10769 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit refactors test-child-process-spawnsync-maxbuf.js, and adds testing for the case where maxBuffer is Infinity. PR-URL: nodejs#10769 Reviewed-By: James M Snell <jasnell@gmail.com>
|
@cjihrig why is this semver-major? Is it because you added validation for some args? |
Sorry, something went wrong.
|
Yes. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
child_process
Closes #10767