| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int.
There was a problem hiding this comment.
LGTM, but I'd personally like a better error than "Unknown failure"
Sorry, something went wrong.
|
@cjihrig I was on the fence about adding a new error code. We have a small set so far and was not sure we'd want to add a lot of individual ones and I don't think this particular one will be occur very often. If we think its important I'll add. |
Sorry, something went wrong.
|
@mhdawson What about napi_invalid_arg? That sounds a bit better? |
Sorry, something went wrong.
|
I had started with that but the string for it seemed wrong. Thinking about it more though I should probably just change the string as it does not match the name. The current string is: "Invalid pointer passed as argument", But I should probably just update that to: "Invalid argument", Unless I hear other better suggestions I'll update to use napi_invalid_arg and update the corresponding message for it. |
Sorry, something went wrong.
|
Pushed change to address comments. CI run: https://ci.nodejs.org/job/node-test-pull-request/10282/ |
Sorry, something went wrong.
|
Seems like test failed on 32 bit machines, need to tweak. |
Sorry, something went wrong.
|
Pushed change to fix test failure on 32 bit platforms. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Arms issues were infra problems but would like to see tests run/pass there so kicked off a new ci run: https://ci.nodejs.org/job/node-test-pull-request/10336/ |
Sorry, something went wrong.
Sorry, something went wrong.
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. PR-URL: #15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. PR-URL: nodejs/node#15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
|
I am not sure why but I get this error on my local machine === release test ===
Path: addons-napi/test_string/test
assert.js:686
throw actual;
^
TypeError: test_string.TestLargeUtf8 is not a function
at assert.throws (/home/ruben/repos/node/node/test/addons-napi/test_string/test.js:74:15)
at tryBlock (assert.js:656:5)
at innerThrows (assert.js:675:18)
at Function.throws (assert.js:702:3)
at Object.<anonymous> (/home/ruben/repos/node/node/test/addons-napi/test_string/test.js:73:8)
at Module._compile (module.js:600:30)
at Object.Module._extensions..js (module.js:611:10)
at Module.load (module.js:521:32)
at tryModuleLoad (module.js:484:12)
at Function.Module._load (module.js:476:3)
Command: out/Release/node /home/ruben/repos/node/node/test/addons-napi/test_string/test.js
[02:57|% 100|+ 1970|- 1]: Done
|
Sorry, something went wrong.
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. PR-URL: #15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. PR-URL: #15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. PR-URL: #15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. PR-URL: nodejs#15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
n-api uses size_t for the size of strings when specifying string lengths. V8 only supports a size of int. Add a check so that an error will be returned if the user passes in a string with a size larger than will fit into an int. Backport-PR-URL: #19447 PR-URL: #15611 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
| Back | FazBrowse Home | New Git URL |
n-api uses size_t for the size of strings when specifying
string lengths. V8 only supports a size of int. Add
a check so that an error will be returned if the user
passes in a string with a size larger than will fit into
an int.
Checklist
Affected core subsystem(s)
n-api