GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: return `v8::Object` from error constructors · nodejs/node@90ff714

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_errors.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_errors.h‎

Copy file name to clipboardExpand all lines: src/node_errors.h
+12-14Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details);
106106

107107
#define V(code, type) \
108108
template <typename... Args> \
109-
inline v8::Local<v8::Value> code( \
109+
inline v8::Local<v8::Object> code( \
110110
v8::Isolate* isolate, const char* format, Args&&... args) { \
111111
std::string message = SPrintF(format, std::forward<Args>(args)...); \
112112
v8::Local<v8::String> js_code = OneByteString(isolate, #code); \
@@ -206,17 +206,15 @@ ERRORS_WITH_CODE(V)
206206
"Accessing Object.prototype.__proto__ has been " \
207207
"disallowed with --disable-proto=throw")
208208

209-
#define V(code, message) \
210-
inline v8::Local<v8::Value> code(v8::Isolate* isolate) { \
211-
return code(isolate, message); \
212-
} \
213-
inline void THROW_ ## code(v8::Isolate* isolate) { \
214-
isolate->ThrowException(code(isolate, message)); \
215-
} \
216-
inline void THROW_ ## code(Environment* env) { \
217-
THROW_ ## code(env->isolate()); \
218-
}
219-
PREDEFINED_ERROR_MESSAGES(V)
209+
#define V(code, message) \
210+
inline v8::Local<v8::Object> code(v8::Isolate* isolate) { \
211+
return code(isolate, message); \
212+
} \
213+
inline void THROW_##code(v8::Isolate* isolate) { \
214+
isolate->ThrowException(code(isolate, message)); \
215+
} \
216+
inline void THROW_##code(Environment* env) { THROW_##code(env->isolate()); }
217+
PREDEFINED_ERROR_MESSAGES(V)
220218
#undef V
221219

222220
// Errors with predefined non-static messages
@@ -228,15 +226,15 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env,
228226
THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(env, message.str().c_str());
229227
}
230228

231-
inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
229+
inline v8::Local<v8::Object> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
232230
char message[128];
233231
snprintf(message, sizeof(message),
234232
"Cannot create a Buffer larger than 0x%zx bytes",
235233
v8::TypedArray::kMaxLength);
236234
return ERR_BUFFER_TOO_LARGE(isolate, message);
237235
}
238236

239-
inline v8::Local<v8::Value> ERR_STRING_TOO_LONG(v8::Isolate* isolate) {
237+
inline v8::Local<v8::Object> ERR_STRING_TOO_LONG(v8::Isolate* isolate) {
240238
char message[128];
241239
snprintf(message, sizeof(message),
242240
"Cannot create a string longer than 0x%x characters",

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.