Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-01-21 22:30:35 +0300
committerAnna Henningsen <anna@addaleax.net>2020-01-24 00:39:00 +0300
commit32e7e813e93ec3d0625d315658288769e448dd99 (patch)
tree9479d9ed447e6a75b158a43a558e3aadb2b1db63 /src/util.h
parent9cc747bfcea131797fbf0fcc805f1d7fa244b7da (diff)
src: use custom fprintf alike to write errors to stderr
This allows printing errors that contain nul characters, for example. Fixes: https://github.com/nodejs/node/issues/28761 Fixes: https://github.com/nodejs/node/issues/31218 PR-URL: https://github.com/nodejs/node/pull/31446 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 2f6c17fc321..c020f356219 100644
--- a/src/util.h
+++ b/src/util.h
@@ -473,6 +473,8 @@ class ArrayBufferViewContents {
class Utf8Value : public MaybeStackBuffer<char> {
public:
explicit Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> value);
+
+ inline std::string ToString() const { return std::string(out(), length()); }
};
class TwoByteValue : public MaybeStackBuffer<uint16_t> {
@@ -483,6 +485,8 @@ class TwoByteValue : public MaybeStackBuffer<uint16_t> {
class BufferValue : public MaybeStackBuffer<char> {
public:
explicit BufferValue(v8::Isolate* isolate, v8::Local<v8::Value> value);
+
+ inline std::string ToString() const { return std::string(out(), length()); }
};
#define SPREAD_BUFFER_ARG(val, name) \