Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.216.250
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
include /
nodejs /
src /
Delete
Unzip
Name
Size
Permission
Date
Action
crypto
[ DIR ]
drwxr-xr-x
2024-07-10 10:55
permission
[ DIR ]
drwxr-xr-x
2024-07-10 10:55
tracing
[ DIR ]
drwxr-xr-x
2024-07-10 10:55
acorn_version.h
209
B
-rw-r--r--
2024-04-18 19:08
aliased_buffer-inl.h
7.44
KB
-rw-r--r--
2024-02-13 21:40
aliased_buffer.h
6.05
KB
-rw-r--r--
2024-02-13 21:40
aliased_struct-inl.h
1.32
KB
-rw-r--r--
2024-02-13 21:40
aliased_struct.h
1.44
KB
-rw-r--r--
2024-02-13 21:40
async_wrap-inl.h
2.68
KB
-rw-r--r--
2024-02-13 21:40
async_wrap.h
11.32
KB
-rw-r--r--
2024-02-13 21:40
base64-inl.h
5.76
KB
-rw-r--r--
2024-02-13 21:40
base64.h
1.43
KB
-rw-r--r--
2024-02-13 21:40
base64_version.h
227
B
-rw-r--r--
2024-02-13 21:40
base_object-inl.h
8.94
KB
-rw-r--r--
2024-02-13 21:40
base_object.h
13.3
KB
-rw-r--r--
2024-02-13 21:40
base_object_types.h
3.28
KB
-rw-r--r--
2024-02-13 21:40
blob_serializer_deserializer-inl.h
10.54
KB
-rw-r--r--
2024-02-13 21:40
blob_serializer_deserializer.h
3.56
KB
-rw-r--r--
2024-02-13 21:40
callback_queue-inl.h
2.59
KB
-rw-r--r--
2024-02-13 21:40
callback_queue.h
1.96
KB
-rw-r--r--
2024-02-13 21:40
cares_wrap.h
14.37
KB
-rw-r--r--
2024-04-18 19:08
cjs_module_lexer_version.h
277
B
-rw-r--r--
2024-04-18 19:08
cleanup_queue-inl.h
1.58
KB
-rw-r--r--
2024-02-13 21:40
cleanup_queue.h
2.19
KB
-rw-r--r--
2024-02-13 21:40
connect_wrap.h
584
B
-rw-r--r--
2024-02-13 21:40
connection_wrap.h
686
B
-rw-r--r--
2024-02-13 21:40
debug_utils-inl.h
7.42
KB
-rw-r--r--
2024-02-13 21:40
debug_utils.h
6.77
KB
-rw-r--r--
2024-02-13 21:40
diagnosticfilename-inl.h
768
B
-rw-r--r--
2024-02-13 21:40
env-inl.h
25.59
KB
-rw-r--r--
2024-02-13 21:40
env.h
38.85
KB
-rw-r--r--
2024-02-13 21:40
env_properties.h
33.32
KB
-rw-r--r--
2024-02-13 21:40
handle_wrap.h
4.16
KB
-rw-r--r--
2024-02-13 21:40
histogram-inl.h
2.39
KB
-rw-r--r--
2024-02-13 21:40
histogram.h
7.89
KB
-rw-r--r--
2024-02-13 21:40
inspector_agent.h
4.69
KB
-rw-r--r--
2024-02-13 21:40
inspector_io.h
2.19
KB
-rw-r--r--
2024-02-13 21:40
inspector_profiler.h
4.53
KB
-rw-r--r--
2024-02-13 21:40
inspector_socket.h
1.53
KB
-rw-r--r--
2024-02-13 21:40
inspector_socket_server.h
3.5
KB
-rw-r--r--
2024-02-13 21:40
js_native_api.h
31.22
KB
-rw-r--r--
2024-02-13 21:40
js_native_api_types.h
4.44
KB
-rw-r--r--
2024-02-13 21:40
js_native_api_v8.h
16.83
KB
-rw-r--r--
2024-02-13 21:40
js_native_api_v8_internals.h
1.56
KB
-rw-r--r--
2024-02-13 21:40
js_stream.h
1.35
KB
-rw-r--r--
2024-02-13 21:40
json_utils.h
3.8
KB
-rw-r--r--
2024-02-13 21:40
memory_tracker-inl.h
12.01
KB
-rw-r--r--
2024-02-13 21:40
memory_tracker.h
11.55
KB
-rw-r--r--
2024-02-13 21:40
module_wrap.h
3.72
KB
-rw-r--r--
2024-02-13 21:40
node.h
56.44
KB
-rw-r--r--
2024-02-13 21:40
node_api.h
9.96
KB
-rw-r--r--
2024-02-13 21:40
node_api_internals.h
1.24
KB
-rw-r--r--
2024-02-13 21:40
node_api_types.h
1.57
KB
-rw-r--r--
2024-02-13 21:40
node_binding.h
4.19
KB
-rw-r--r--
2024-02-13 21:40
node_blob.h
5.04
KB
-rw-r--r--
2024-02-13 21:40
node_bob-inl.h
657
B
-rw-r--r--
2024-02-13 21:40
node_bob.h
2.82
KB
-rw-r--r--
2024-02-13 21:40
node_buffer.h
3.6
KB
-rw-r--r--
2024-02-13 21:40
node_builtins.h
5.63
KB
-rw-r--r--
2024-02-13 21:40
node_constants.h
3.67
KB
-rw-r--r--
2024-02-13 21:40
node_context_data.h
2.94
KB
-rw-r--r--
2024-02-13 21:40
node_contextify.h
7.63
KB
-rw-r--r--
2024-02-13 21:40
node_crypto.h
2.27
KB
-rw-r--r--
2024-02-13 21:40
node_dir.h
1.31
KB
-rw-r--r--
2024-02-13 21:40
node_dtrace.h
2.89
KB
-rw-r--r--
2024-02-13 21:40
node_errors.h
16.86
KB
-rw-r--r--
2024-02-13 21:40
node_external_reference.h
7.86
KB
-rw-r--r--
2024-02-13 21:40
node_file-inl.h
12.45
KB
-rw-r--r--
2024-02-13 21:40
node_file.h
14.7
KB
-rw-r--r--
2024-02-13 21:40
node_http2.h
38.61
KB
-rw-r--r--
2024-02-13 21:40
node_http2_state.h
4.76
KB
-rw-r--r--
2024-02-13 21:40
node_http_common-inl.h
5.46
KB
-rw-r--r--
2024-02-13 21:40
node_http_common.h
24.56
KB
-rw-r--r--
2024-02-13 21:40
node_i18n.h
4.34
KB
-rw-r--r--
2024-02-13 21:40
node_internals.h
15.03
KB
-rw-r--r--
2024-02-13 21:40
node_main_instance.h
2.96
KB
-rw-r--r--
2024-02-13 21:40
node_mem-inl.h
3.6
KB
-rw-r--r--
2024-02-13 21:40
node_mem.h
1.27
KB
-rw-r--r--
2024-02-13 21:40
node_messaging.h
14.3
KB
-rw-r--r--
2024-02-13 21:40
node_metadata.h
4.37
KB
-rw-r--r--
2024-02-13 21:40
node_mutex.h
7.78
KB
-rw-r--r--
2024-02-13 21:40
node_object_wrap.h
3.78
KB
-rw-r--r--
2024-02-13 21:40
node_options-inl.h
15.86
KB
-rw-r--r--
2024-02-13 21:40
node_options.h
17.57
KB
-rw-r--r--
2024-02-13 21:40
node_perf.h
4.76
KB
-rw-r--r--
2024-02-13 21:40
node_perf_common.h
2.88
KB
-rw-r--r--
2024-02-13 21:40
node_platform.h
6.19
KB
-rw-r--r--
2024-02-13 21:40
node_process-inl.h
737
B
-rw-r--r--
2024-02-13 21:40
node_process.h
3.36
KB
-rw-r--r--
2024-02-13 21:40
node_realm-inl.h
4.59
KB
-rw-r--r--
2024-02-13 21:40
node_realm.h
5.38
KB
-rw-r--r--
2024-02-13 21:40
node_report.h
994
B
-rw-r--r--
2024-02-13 21:40
node_revert.h
2.09
KB
-rw-r--r--
2024-02-13 21:40
node_root_certs.h
231.49
KB
-rw-r--r--
2024-02-13 21:40
node_sea.h
517
B
-rw-r--r--
2024-02-13 21:40
node_shadow_realm.h
449
B
-rw-r--r--
2024-02-13 21:40
node_snapshot_builder.h
1.21
KB
-rw-r--r--
2024-02-13 21:40
node_snapshotable.h
4.82
KB
-rw-r--r--
2024-02-13 21:40
node_sockaddr-inl.h
7.28
KB
-rw-r--r--
2024-02-13 21:40
node_sockaddr.h
12.91
KB
-rw-r--r--
2024-02-13 21:40
node_stat_watcher.h
2.36
KB
-rw-r--r--
2024-02-13 21:40
node_threadsafe_cow-inl.h
1.28
KB
-rw-r--r--
2024-02-13 21:40
node_threadsafe_cow.h
2.78
KB
-rw-r--r--
2024-02-13 21:40
node_union_bytes.h
1.66
KB
-rw-r--r--
2024-02-13 21:40
node_url.h
2.13
KB
-rw-r--r--
2024-02-13 21:40
node_util.h
1.39
KB
-rw-r--r--
2024-02-13 21:40
node_v8.h
1.67
KB
-rw-r--r--
2024-02-13 21:40
node_v8_platform-inl.h
6.63
KB
-rw-r--r--
2024-02-13 21:40
node_version.h
3.85
KB
-rw-r--r--
2024-04-18 19:08
node_wasi.h
5.21
KB
-rw-r--r--
2024-02-13 21:40
node_wasm_web_api.h
1.78
KB
-rw-r--r--
2024-02-13 21:40
node_watchdog.h
4.32
KB
-rw-r--r--
2024-02-13 21:40
node_win32_etw_provider-inl.h
11.53
KB
-rw-r--r--
2024-02-13 21:40
node_win32_etw_provider.h
3.67
KB
-rw-r--r--
2024-02-13 21:40
node_worker.h
4.92
KB
-rw-r--r--
2024-02-13 21:40
pipe_wrap.h
2.78
KB
-rw-r--r--
2024-02-13 21:40
req_wrap-inl.h
5.43
KB
-rw-r--r--
2024-02-13 21:40
req_wrap.h
2.23
KB
-rw-r--r--
2024-02-13 21:40
spawn_sync.h
6.87
KB
-rw-r--r--
2024-02-13 21:40
stream_base-inl.h
4.93
KB
-rw-r--r--
2024-02-13 21:40
stream_base.h
17.44
KB
-rw-r--r--
2024-02-13 21:40
stream_pipe.h
2.39
KB
-rw-r--r--
2024-02-13 21:40
stream_wrap.h
4.15
KB
-rw-r--r--
2024-02-13 21:40
string_bytes.h
4.69
KB
-rw-r--r--
2024-02-13 21:40
string_decoder-inl.h
858
B
-rw-r--r--
2024-02-13 21:40
string_decoder.h
1.5
KB
-rw-r--r--
2024-02-13 21:40
string_search.h
20.94
KB
-rw-r--r--
2024-02-13 21:40
tcp_wrap.h
3.9
KB
-rw-r--r--
2024-02-13 21:40
threadpoolwork-inl.h
2.58
KB
-rw-r--r--
2024-02-13 21:40
timer_wrap-inl.h
755
B
-rw-r--r--
2024-02-13 21:40
timer_wrap.h
1.79
KB
-rw-r--r--
2024-02-13 21:40
tty_wrap.h
2.27
KB
-rw-r--r--
2024-02-13 21:40
udp_wrap.h
8.5
KB
-rw-r--r--
2024-02-13 21:40
undici_version.h
215
B
-rw-r--r--
2024-04-18 19:08
util-inl.h
19.56
KB
-rw-r--r--
2024-02-13 21:40
util.h
31.46
KB
-rw-r--r--
2024-02-13 21:40
v8abbr.h
5.05
KB
-rw-r--r--
2024-02-13 21:40
Save
Rename
#ifndef SRC_NODE_ERRORS_H_ #define SRC_NODE_ERRORS_H_ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "debug_utils-inl.h" #include "env.h" #include "v8.h" // Use ostringstream to print exact-width integer types // because the format specifiers are not available on AIX. #include <sstream> namespace node { enum ErrorHandlingMode { CONTEXTIFY_ERROR, FATAL_ERROR, MODULE_ERROR }; void AppendExceptionLine(Environment* env, v8::Local<v8::Value> er, v8::Local<v8::Message> message, enum ErrorHandlingMode mode); [[noreturn]] void FatalError(const char* location, const char* message); [[noreturn]] void OnFatalError(const char* location, const char* message); [[noreturn]] void OOMErrorHandler(const char* location, bool is_heap_oom); // Helpers to construct errors similar to the ones provided by // lib/internal/errors.js. // Example: with `V(ERR_INVALID_ARG_TYPE, TypeError)`, there will be // `node::ERR_INVALID_ARG_TYPE(isolate, "message")` returning // a `Local<Value>` containing the TypeError with proper code and message #define ERRORS_WITH_CODE(V) \ V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, Error) \ V(ERR_BUFFER_OUT_OF_BOUNDS, RangeError) \ V(ERR_BUFFER_TOO_LARGE, Error) \ V(ERR_CLOSED_MESSAGE_PORT, Error) \ V(ERR_CONSTRUCT_CALL_REQUIRED, TypeError) \ V(ERR_CONSTRUCT_CALL_INVALID, TypeError) \ V(ERR_CRYPTO_INITIALIZATION_FAILED, Error) \ V(ERR_CRYPTO_INVALID_AUTH_TAG, TypeError) \ V(ERR_CRYPTO_INVALID_COUNTER, TypeError) \ V(ERR_CRYPTO_INVALID_CURVE, TypeError) \ V(ERR_CRYPTO_INVALID_DIGEST, TypeError) \ V(ERR_CRYPTO_INVALID_IV, TypeError) \ V(ERR_CRYPTO_INVALID_JWK, TypeError) \ V(ERR_CRYPTO_INVALID_KEYLEN, RangeError) \ V(ERR_CRYPTO_INVALID_KEYPAIR, RangeError) \ V(ERR_CRYPTO_INVALID_KEYTYPE, RangeError) \ V(ERR_CRYPTO_INVALID_MESSAGELEN, RangeError) \ V(ERR_CRYPTO_INVALID_SCRYPT_PARAMS, RangeError) \ V(ERR_CRYPTO_INVALID_STATE, Error) \ V(ERR_CRYPTO_INVALID_TAG_LENGTH, RangeError) \ V(ERR_CRYPTO_JWK_UNSUPPORTED_CURVE, Error) \ V(ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE, Error) \ V(ERR_CRYPTO_OPERATION_FAILED, Error) \ V(ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH, RangeError) \ V(ERR_CRYPTO_UNKNOWN_CIPHER, Error) \ V(ERR_CRYPTO_UNKNOWN_DH_GROUP, Error) \ V(ERR_CRYPTO_UNSUPPORTED_OPERATION, Error) \ V(ERR_CRYPTO_JOB_INIT_FAILED, Error) \ V(ERR_DLOPEN_DISABLED, Error) \ V(ERR_DLOPEN_FAILED, Error) \ V(ERR_ENCODING_INVALID_ENCODED_DATA, TypeError) \ V(ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE, Error) \ V(ERR_ILLEGAL_CONSTRUCTOR, Error) \ V(ERR_INVALID_ADDRESS, Error) \ V(ERR_INVALID_ARG_VALUE, TypeError) \ V(ERR_OSSL_EVP_INVALID_DIGEST, Error) \ V(ERR_INVALID_ARG_TYPE, TypeError) \ V(ERR_INVALID_OBJECT_DEFINE_PROPERTY, TypeError) \ V(ERR_INVALID_MODULE, Error) \ V(ERR_INVALID_STATE, Error) \ V(ERR_INVALID_THIS, TypeError) \ V(ERR_INVALID_TRANSFER_OBJECT, TypeError) \ V(ERR_MEMORY_ALLOCATION_FAILED, Error) \ V(ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE, Error) \ V(ERR_MISSING_ARGS, TypeError) \ V(ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST, TypeError) \ V(ERR_MISSING_PASSPHRASE, TypeError) \ V(ERR_MISSING_PLATFORM_FOR_WORKER, Error) \ V(ERR_NON_CONTEXT_AWARE_DISABLED, Error) \ V(ERR_OUT_OF_RANGE, RangeError) \ V(ERR_SCRIPT_EXECUTION_INTERRUPTED, Error) \ V(ERR_SCRIPT_EXECUTION_TIMEOUT, Error) \ V(ERR_STRING_TOO_LONG, Error) \ V(ERR_TLS_INVALID_PROTOCOL_METHOD, TypeError) \ V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, Error) \ V(ERR_VM_MODULE_CACHED_DATA_REJECTED, Error) \ V(ERR_VM_MODULE_LINK_FAILURE, Error) \ V(ERR_WASI_NOT_STARTED, Error) \ V(ERR_WORKER_INIT_FAILED, Error) \ V(ERR_PROTO_ACCESS, Error) #define V(code, type) \ template <typename... Args> \ inline v8::Local<v8::Value> code( \ v8::Isolate* isolate, const char* format, Args&&... args) { \ std::string message = SPrintF(format, std::forward<Args>(args)...); \ v8::Local<v8::String> js_code = OneByteString(isolate, #code); \ v8::Local<v8::String> js_msg = \ OneByteString(isolate, message.c_str(), message.length()); \ v8::Local<v8::Object> e = v8::Exception::type(js_msg) \ ->ToObject(isolate->GetCurrentContext()) \ .ToLocalChecked(); \ e->Set(isolate->GetCurrentContext(), \ OneByteString(isolate, "code"), \ js_code) \ .Check(); \ return e; \ } \ template <typename... Args> \ inline void THROW_##code( \ v8::Isolate* isolate, const char* format, Args&&... args) { \ isolate->ThrowException( \ code(isolate, format, std::forward<Args>(args)...)); \ } \ template <typename... Args> \ inline void THROW_##code( \ Environment* env, const char* format, Args&&... args) { \ THROW_##code(env->isolate(), format, std::forward<Args>(args)...); \ } ERRORS_WITH_CODE(V) #undef V // Errors with predefined static messages #define PREDEFINED_ERROR_MESSAGES(V) \ V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, \ "Buffer is not available for the current Context") \ V(ERR_CLOSED_MESSAGE_PORT, "Cannot send data on closed MessagePort") \ V(ERR_CONSTRUCT_CALL_INVALID, "Constructor cannot be called") \ V(ERR_CONSTRUCT_CALL_REQUIRED, "Cannot call constructor without `new`") \ V(ERR_CRYPTO_INITIALIZATION_FAILED, "Initialization failed") \ V(ERR_CRYPTO_INVALID_AUTH_TAG, "Invalid authentication tag") \ V(ERR_CRYPTO_INVALID_COUNTER, "Invalid counter") \ V(ERR_CRYPTO_INVALID_CURVE, "Invalid EC curve name") \ V(ERR_CRYPTO_INVALID_DIGEST, "Invalid digest") \ V(ERR_CRYPTO_INVALID_IV, "Invalid initialization vector") \ V(ERR_CRYPTO_INVALID_JWK, "Invalid JWK format") \ V(ERR_CRYPTO_INVALID_KEYLEN, "Invalid key length") \ V(ERR_CRYPTO_INVALID_KEYPAIR, "Invalid key pair") \ V(ERR_CRYPTO_INVALID_KEYTYPE, "Invalid key type") \ V(ERR_CRYPTO_INVALID_MESSAGELEN, "Invalid message length") \ V(ERR_CRYPTO_INVALID_SCRYPT_PARAMS, "Invalid scrypt params") \ V(ERR_CRYPTO_INVALID_STATE, "Invalid state") \ V(ERR_CRYPTO_INVALID_TAG_LENGTH, "Invalid taglength") \ V(ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE, "Unsupported JWK Key Type.") \ V(ERR_CRYPTO_OPERATION_FAILED, "Operation failed") \ V(ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH, \ "Input buffers must have the same byte length") \ V(ERR_CRYPTO_UNKNOWN_CIPHER, "Unknown cipher") \ V(ERR_CRYPTO_UNKNOWN_DH_GROUP, "Unknown DH group") \ V(ERR_CRYPTO_UNSUPPORTED_OPERATION, "Unsupported crypto operation") \ V(ERR_CRYPTO_JOB_INIT_FAILED, "Failed to initialize crypto job config") \ V(ERR_DLOPEN_FAILED, "DLOpen failed") \ V(ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE, \ "Context not associated with Node.js environment") \ V(ERR_ILLEGAL_CONSTRUCTOR, "Illegal constructor") \ V(ERR_INVALID_ADDRESS, "Invalid socket address") \ V(ERR_INVALID_MODULE, "No such module") \ V(ERR_INVALID_THIS, "Value of \"this\" is the wrong type") \ V(ERR_INVALID_TRANSFER_OBJECT, "Found invalid object in transferList") \ V(ERR_MEMORY_ALLOCATION_FAILED, "Failed to allocate memory") \ V(ERR_OSSL_EVP_INVALID_DIGEST, "Invalid digest used") \ V(ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE, \ "A message object could not be deserialized successfully in the target " \ "vm.Context") \ V(ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST, \ "Object that needs transfer was found in message but not listed " \ "in transferList") \ V(ERR_MISSING_PLATFORM_FOR_WORKER, \ "The V8 platform used by this instance of Node does not support " \ "creating Workers") \ V(ERR_NON_CONTEXT_AWARE_DISABLED, \ "Loading non context-aware native addons has been disabled") \ V(ERR_SCRIPT_EXECUTION_INTERRUPTED, \ "Script execution was interrupted by `SIGINT`") \ V(ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED, "Failed to set PSK identity hint") \ V(ERR_WASI_NOT_STARTED, "wasi.start() has not been called") \ V(ERR_WORKER_INIT_FAILED, "Worker initialization failure") \ V(ERR_PROTO_ACCESS, \ "Accessing Object.prototype.__proto__ has been " \ "disallowed with --disable-proto=throw") #define V(code, message) \ inline v8::Local<v8::Value> code(v8::Isolate* isolate) { \ return code(isolate, message); \ } \ inline void THROW_ ## code(v8::Isolate* isolate) { \ isolate->ThrowException(code(isolate, message)); \ } \ inline void THROW_ ## code(Environment* env) { \ THROW_ ## code(env->isolate()); \ } PREDEFINED_ERROR_MESSAGES(V) #undef V // Errors with predefined non-static messages inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env, int64_t timeout) { std::ostringstream message; message << "Script execution timed out after "; message << timeout << "ms"; THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(env, message.str().c_str()); } inline v8::Local<v8::Value> ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) { char message[128]; snprintf(message, sizeof(message), "Cannot create a Buffer larger than 0x%zx bytes", v8::TypedArray::kMaxLength); return ERR_BUFFER_TOO_LARGE(isolate, message); } inline v8::Local<v8::Value> ERR_STRING_TOO_LONG(v8::Isolate* isolate) { char message[128]; snprintf(message, sizeof(message), "Cannot create a string longer than 0x%x characters", v8::String::kMaxLength); return ERR_STRING_TOO_LONG(isolate, message); } #define THROW_AND_RETURN_IF_NOT_BUFFER(env, val, prefix) \ do { \ if (!Buffer::HasInstance(val)) \ return node::THROW_ERR_INVALID_ARG_TYPE(env, \ prefix " must be a buffer"); \ } while (0) #define THROW_AND_RETURN_IF_NOT_STRING(env, val, prefix) \ do { \ if (!val->IsString()) \ return node::THROW_ERR_INVALID_ARG_TYPE(env, \ prefix " must be a string"); \ } while (0) namespace errors { class TryCatchScope : public v8::TryCatch { public: enum class CatchMode { kNormal, kFatal }; explicit TryCatchScope(Environment* env, CatchMode mode = CatchMode::kNormal) : v8::TryCatch(env->isolate()), env_(env), mode_(mode) {} ~TryCatchScope(); // Since the dtor is not virtual we need to make sure no one creates // object of it in the free store that might be held by polymorphic pointers. void* operator new(std::size_t count) = delete; void* operator new[](std::size_t count) = delete; TryCatchScope(TryCatchScope&) = delete; TryCatchScope(TryCatchScope&&) = delete; TryCatchScope operator=(TryCatchScope&) = delete; TryCatchScope operator=(TryCatchScope&&) = delete; private: Environment* env_; CatchMode mode_; }; // Trigger the global uncaught exception handler `process._fatalException` // in JS land (which emits the 'uncaughtException' event). If that returns // true, continue program execution, otherwise exit the process. void TriggerUncaughtException(v8::Isolate* isolate, const v8::TryCatch& try_catch); void TriggerUncaughtException(v8::Isolate* isolate, v8::Local<v8::Value> error, v8::Local<v8::Message> message, bool from_promise = false); const char* errno_string(int errorno); void PerIsolateMessageListener(v8::Local<v8::Message> message, v8::Local<v8::Value> error); void DecorateErrorStack(Environment* env, const errors::TryCatchScope& try_catch); } // namespace errors v8::ModifyCodeGenerationFromStringsResult ModifyCodeGenerationFromStrings( v8::Local<v8::Context> context, v8::Local<v8::Value> source, bool is_code_like); } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_NODE_ERRORS_H_