diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-04-07 20:36:33 +0800 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-04-10 01:08:10 +0200 |
commit | 362694401fc08f1eb312417487bfc2d3c9281a6e (patch) | |
tree | 0922c3b51834356953d886141348bd180027a742 /test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js | |
parent | 5b8c62c60d63a0da00da20823ce6fed7039036a7 (diff) | |
download | android-node-v8-362694401fc08f1eb312417487bfc2d3c9281a6e.tar.gz android-node-v8-362694401fc08f1eb312417487bfc2d3c9281a6e.tar.bz2 android-node-v8-362694401fc08f1eb312417487bfc2d3c9281a6e.zip |
src: rename ERR_STRING_TOO_LARGE to ERR_STRING_TOO_LONG
The old error name and message were trying to be consistent with
ERR_BUFFER_TOO_LARGE but they were not really accurate.
The kStringMaxLength was measured in number of characters,
not number of bytes. The name ERR_STRING_TOO_LARGE also
seems a bit awkward. This patch tries to correct them before
they get released to users.
PR-URL: https://github.com/nodejs/node/pull/19864
Refs: https://github.com/nodejs/node/pull/19739
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js')
-rw-r--r-- | test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js index bc64ef396d..18fb46e0df 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js @@ -28,7 +28,8 @@ const stringLengthHex = kStringMaxLength.toString(16); common.expectsError(function() { buf.toString('hex'); }, { - message: `Cannot create a string larger than 0x${stringLengthHex} bytes`, - code: 'ERR_STRING_TOO_LARGE', + message: `Cannot create a string longer than 0x${stringLengthHex} ` + + 'characters', + code: 'ERR_STRING_TOO_LONG', type: Error }); |