@@ -113,7 +113,7 @@ void OOMErrorHandler(const char* location, const v8::OOMDetails& details);
113
113
114
114
#define V (code, type ) \
115
115
template <typename ... Args> \
116
- inline v8::Local<v8::Value > code ( \
116
+ inline v8::Local<v8::Object > code ( \
117
117
v8::Isolate* isolate, const char * format, Args&&... args) { \
118
118
std::string message = SPrintF (format, std::forward<Args>(args)...); \
119
119
v8::Local<v8::String> js_code = OneByteString (isolate, #code); \
@@ -209,17 +209,15 @@ ERRORS_WITH_CODE(V)
209
209
" Accessing Object.prototype.__proto__ has been " \
210
210
" disallowed with --disable-proto=throw" )
211
211
212
- #define V (code, message ) \
213
- inline v8::Local<v8::Value> code (v8::Isolate* isolate) { \
214
- return code (isolate, message); \
215
- } \
216
- inline void THROW_ ## code(v8::Isolate* isolate) { \
217
- isolate->ThrowException (code (isolate, message)); \
218
- } \
219
- inline void THROW_ ## code(Environment* env) { \
220
- THROW_ ## code (env->isolate ()); \
221
- }
222
- PREDEFINED_ERROR_MESSAGES (V)
212
+ #define V (code, message ) \
213
+ inline v8::Local<v8::Object> code (v8::Isolate* isolate) { \
214
+ return code (isolate, message); \
215
+ } \
216
+ inline void THROW_##code(v8::Isolate* isolate) { \
217
+ isolate->ThrowException (code (isolate, message)); \
218
+ } \
219
+ inline void THROW_##code(Environment* env) { THROW_##code (env->isolate ()); }
220
+ PREDEFINED_ERROR_MESSAGES (V)
223
221
#undef V
224
222
225
223
// Errors with predefined non-static messages
@@ -231,7 +229,7 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env,
231
229
THROW_ERR_SCRIPT_EXECUTION_TIMEOUT (env, message.str ().c_str ());
232
230
}
233
231
234
- inline v8::Local<v8::Value > ERR_BUFFER_TOO_LARGE (v8::Isolate* isolate) {
232
+ inline v8::Local<v8::Object > ERR_BUFFER_TOO_LARGE (v8::Isolate* isolate) {
235
233
char message[128 ];
236
234
snprintf (message,
237
235
sizeof (message),
@@ -240,7 +238,7 @@ inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) {
240
238
return ERR_BUFFER_TOO_LARGE (isolate, message);
241
239
}
242
240
243
- inline v8::Local<v8::Value > ERR_STRING_TOO_LONG (v8::Isolate* isolate) {
241
+ inline v8::Local<v8::Object > ERR_STRING_TOO_LONG (v8::Isolate* isolate) {
244
242
char message[128 ];
245
243
snprintf (message, sizeof (message),
246
244
" Cannot create a string longer than 0x%x characters" ,
0 commit comments