duktape
duktape copied to clipboard
Buffer#toString throw on unsupported encodings
Fixes #2417
New behavior: if argument is not undefined/unspecified or "utf8"
, throw an error.
Note: null
is not a supported encoding in NodeJS
The core logic has been factored out since both Buffer.isEncoding
and Buffer#toString
have to check the encoding.
For the case insensitive matching, raw bit-ops are preferred since the strcmp
variants (stricmp
/ strcasecmp
) and the ctypes.h
utilities (tolower
/ toupper
) are not currently used.
Both Buffer#toString
and Buffer.isEncoding
tests have been refreshed.
Thanks for the revisions :+1:
I'm merging the clang-format indent changes to master and to v2-maintenance. Once that's done, the easiest approach is probably to clang-format your changed files first, and then rebase against master/v2-maintenance. This should keep the diff minimal and avoid conflicts.
Ok, clang-format changes are now in master and v2-maintenance. To reindent code:
$ make docker-image-clang-format
$ make clang-format-source