File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -2173,11 +2173,11 @@ static napi_status set_error_code(napi_env env,
21732173 }
21742174 }
21752175 name_string = v8::String::Concat(
2176- isolate, name_string, FIXED_ONE_BYTE_STRING(isolate, " ["));
2176+ isolate, name_string, node:: FIXED_ONE_BYTE_STRING(isolate, " ["));
21772177 name_string =
21782178 v8::String::Concat(isolate, name_string, code_value.As<v8::String>());
21792179 name_string = v8::String::Concat(
2180- isolate, name_string, FIXED_ONE_BYTE_STRING(isolate, "]"));
2180+ isolate, name_string, node:: FIXED_ONE_BYTE_STRING(isolate, "]"));
21812181
21822182 set_maybe = err_object->Set(context, name_key, name_string);
21832183 RETURN_STATUS_IF_FALSE(env,
Original file line number Diff line number Diff line change @@ -89,9 +89,6 @@ NO_RETURN void Abort();
8989NO_RETURN void Assert(const char* const (*args)[4]);
9090void DumpBacktrace(FILE* fp);
9191
92- #define FIXED_ONE_BYTE_STRING(isolate, string) \
93- (node::OneByteString((isolate), (string), sizeof(string) - 1))
94-
9592#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
9693 void operator=(const TypeName&) = delete; \
9794 void operator=(TypeName&&) = delete; \
@@ -248,6 +245,15 @@ inline v8::Local<v8::String> OneByteString(v8::Isolate* isolate,
248245 const unsigned char* data,
249246 int length = -1);
250247
248+ // Used to be a macro, hence the uppercase name.
249+ template <int N>
250+ inline v8::Local<v8::String> FIXED_ONE_BYTE_STRING(
251+ v8::Isolate* isolate,
252+ const char(&data)[N]) {
253+ return OneByteString(isolate, data, N - 1);
254+ }
255+
256+
251257// Swaps bytes in place. nbytes is the number of bytes to swap and must be a
252258// multiple of the word size (checked by function).
253259inline void SwapBytes16(char* data, size_t nbytes);
You can’t perform that action at this time.
0 commit comments