| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d5e9801 commit 0c32428
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2173,11 +2173,11 @@ static napi_status set_error_code(napi_env env, | |||
| 2173 | 2173 | } | |
| 2174 | 2174 | } | |
| 2175 | 2175 | name_string = v8::String::Concat( | |
| 2176 | - isolate, name_string, FIXED_ONE_BYTE_STRING(isolate, " [")); | ||
| 2176 | + isolate, name_string, node::FIXED_ONE_BYTE_STRING(isolate, " [")); | ||
| 2177 | 2177 | name_string = | |
| 2178 | 2178 | v8::String::Concat(isolate, name_string, code_value.As<v8::String>()); | |
| 2179 | 2179 | name_string = v8::String::Concat( | |
| 2180 | - isolate, name_string, FIXED_ONE_BYTE_STRING(isolate, "]")); | ||
| 2180 | + isolate, name_string, node::FIXED_ONE_BYTE_STRING(isolate, "]")); | ||
| 2181 | 2181 | ||
| 2182 | 2182 | set_maybe = err_object->Set(context, name_key, name_string); | |
| 2183 | 2183 | RETURN_STATUS_IF_FALSE(env, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,9 +89,6 @@ NO_RETURN void Abort(); | |||
| 89 | 89 | NO_RETURN void Assert(const char* const (*args)[4]); | |
| 90 | 90 | void DumpBacktrace(FILE* fp); | |
| 91 | 91 | ||
| 92 | - #define FIXED_ONE_BYTE_STRING(isolate, string) \ | ||
| 93 | - (node::OneByteString((isolate), (string), sizeof(string) - 1)) | ||
| 94 | - | ||
| 95 | 92 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ | |
| 96 | 93 | void operator=(const TypeName&) = delete; \ | |
| 97 | 94 | void operator=(TypeName&&) = delete; \ | |
@@ -248,6 +245,15 @@ inline v8::Local<v8::String> OneByteString(v8::Isolate* isolate, | |||
| 248 | 245 | const unsigned char* data, | |
| 249 | 246 | int length = -1); | |
| 250 | 247 | ||
| 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 | + | ||
| 251 | 257 | // Swaps bytes in place. nbytes is the number of bytes to swap and must be a | |
| 252 | 258 | // multiple of the word size (checked by function). | |
| 253 | 259 | inline void SwapBytes16(char* data, size_t nbytes); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments