Node.js  v8.x
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine
node.cc File Reference
#include "node.h"
#include "node_buffer.h"
#include "node_constants.h"
#include "node_javascript.h"
#include "node_platform.h"
#include "node_version.h"
#include "node_internals.h"
#include "node_revert.h"
#include "node_debug_options.h"
#include "node_perf.h"
#include "ares.h"
#include "async-wrap.h"
#include "async-wrap-inl.h"
#include "env.h"
#include "env-inl.h"
#include "handle_wrap.h"
#include "http_parser.h"
#include "nghttp2/nghttp2ver.h"
#include "req-wrap.h"
#include "req-wrap-inl.h"
#include "string_bytes.h"
#include "tracing/agent.h"
#include "util.h"
#include "uv.h"
#include "v8-debug.h"
#include "v8-profiler.h"
#include "zlib.h"
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <locale.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <string>
#include <vector>
#include <pthread.h>
#include <sys/resource.h>
#include <unistd.h>
Include dependency graph for node.cc:

Go to the source code of this file.

Namespaces

 node
 

Macros

#define ERRNO_CASE(e)   case e: return #e;
 
#define SIGNO_CASE(e)   case e: return #e;
 
#define NANOS_PER_SEC   1000000000
 
#define MICROS_PER_SEC   1e6
 
#define READONLY_PROPERTY(obj, str, var)
 
#define READONLY_DONT_ENUM_PROPERTY(obj, str, var)
 
#define V(code, _, __)
 

Typedefs

using AsyncHooks = node::Environment::AsyncHooks
 

Functions

const char * signo_string (int signo)
 
Local< Value > ErrnoException (Isolate *isolate, int errorno, const char *syscall, const char *msg, const char *path)
 
Local< Value > UVException (Isolate *isolate, int errorno, const char *syscall, const char *msg, const char *path)
 
Local< Value > UVException (Isolate *isolate, int errorno, const char *syscall, const char *msg, const char *path, const char *dest)
 
bool SafeGetenv (const char *key, std::string *text)
 
void AddPromiseHook (v8::Isolate *isolate, promise_hook_func fn, void *arg)
 
MaybeLocal< Value > MakeCallback (Environment *env, Local< Value > recv, const Local< Function > callback, int argc, Local< Value > argv[], async_context asyncContext)
 
MaybeLocal< Value > MakeCallback (Isolate *isolate, Local< Object > recv, const char *method, int argc, Local< Value > argv[], async_context asyncContext)
 
MaybeLocal< Value > MakeCallback (Isolate *isolate, Local< Object > recv, Local< String > symbol, int argc, Local< Value > argv[], async_context asyncContext)
 
MaybeLocal< Value > MakeCallback (Isolate *isolate, Local< Object > recv, Local< Function > callback, int argc, Local< Value > argv[], async_context asyncContext)
 
Local< Value > MakeCallback (Isolate *isolate, Local< Object > recv, const char *method, int argc, Local< Value > *argv)
 
Local< Value > MakeCallback (Isolate *isolate, Local< Object > recv, Local< String > symbol, int argc, Local< Value > *argv)
 
Local< Value > MakeCallback (Isolate *isolate, Local< Object > recv, Local< Function > callback, int argc, Local< Value > *argv)
 
enum encoding ParseEncoding (const char *encoding, enum encoding default_encoding)
 
enum encoding ParseEncoding (Isolate *isolate, Local< Value > encoding_v, enum encoding default_encoding)
 
Local< Value > Encode (Isolate *isolate, const char *buf, size_t len, enum encoding encoding)
 
Local< Value > Encode (Isolate *isolate, const uint16_t *buf, size_t len)
 
ssize_t DecodeBytes (Isolate *isolate, Local< Value > val, enum encoding encoding)
 
ssize_t DecodeWrite (Isolate *isolate, char *buf, size_t buflen, Local< Value > val, enum encoding encoding)
 
bool IsExceptionDecorated (Environment *env, Local< Value > er)
 
void AppendExceptionLine (Environment *env, Local< Value > er, Local< Message > message, enum ErrorHandlingMode mode)
 
void GetActiveHandles (const FunctionCallbackInfo< Value > &args)
 
NO_RETURN void Abort ()
 
NO_RETURN void Assert (const char *const (*args)[4])
 
void node_module_register (void *m)
 
struct node_module * get_builtin_module (const char *name)
 
struct node_module * get_linked_module (const char *name)
 
NO_RETURN void FatalError (const char *location, const char *message)
 
void FatalException (Isolate *isolate, Local< Value > error, Local< Message > message)
 
void FatalException (Isolate *isolate, const TryCatch &try_catch)
 
void ClearFatalExceptionHandlers (Environment *env)
 
void ProcessEmitWarning (Environment *env, const char *fmt,...)
 
void SetupProcessObject (Environment *env, int argc, const char *const *argv, int exec_argc, const char *const *exec_argv)
 
void SignalExit (int signo)
 
void LoadEnvironment (Environment *env)
 
void PlatformInit ()
 
void ProcessArgv (int *argc, const char **argv, int *exec_argc, const char ***exec_argv, bool is_env=false)
 
void Init (int *argc, const char **argv, int *exec_argc, const char ***exec_argv)
 
void RunAtExit (Environment *env)
 
void AtExit (void(*cb)(void *arg), void *arg)
 
void AtExit (Environment *env, void(*cb)(void *arg), void *arg)
 
void EmitBeforeExit (Environment *env)
 
int EmitExit (Environment *env)
 
IsolateData * CreateIsolateData (Isolate *isolate, uv_loop_t *loop)
 
void FreeIsolateData (IsolateData *isolate_data)
 
Environment * CreateEnvironment (IsolateData *isolate_data, Local< Context > context, int argc, const char *const *argv, int exec_argc, const char *const *exec_argv)
 
void FreeEnvironment (Environment *env)
 
int Start (Isolate *isolate, IsolateData *isolate_data, int argc, const char *const *argv, int exec_argc, const char *const *exec_argv)
 
int Start (uv_loop_t *event_loop, int argc, const char *const *argv, int exec_argc, const char *const *exec_argv)
 
int Start (int argc, char **argv)
 

Variables

char ** environ
 
unsigned int reverted = 0
 
bool load_napi_modules = false
 
bool no_deprecation = false
 
bool no_process_warnings = false
 
bool trace_warnings = false
 
bool config_preserve_symlinks = false
 
bool config_experimental_modules = false
 
bool config_pending_deprecation = false
 
std::string config_warning_file
 
bool config_expose_internals = false
 
bool config_expose_http2 = false
 
bool v8_initialized = false
 
bool linux_at_secure = false
 
node::DebugOptions debug_options
 

Macro Definition Documentation

◆ ERRNO_CASE

#define ERRNO_CASE (   e)    case e: return #e;

◆ MICROS_PER_SEC

#define MICROS_PER_SEC   1e6

Definition at line 2434 of file node.cc.

◆ NANOS_PER_SEC

#define NANOS_PER_SEC   1000000000

Definition at line 2412 of file node.cc.

◆ READONLY_DONT_ENUM_PROPERTY

#define READONLY_DONT_ENUM_PROPERTY (   obj,
  str,
  var 
)
Value:
do { \
obj->DefineOwnProperty(env->context(), \
OneByteString(env->isolate(), str), \
var, \
static_cast<v8::PropertyAttribute>(v8::ReadOnly | \
v8::DontEnum)) \
.FromJust(); \
} while (0)

Definition at line 3155 of file node.cc.

Referenced by node::SetupProcessObject().

◆ READONLY_PROPERTY

#define READONLY_PROPERTY (   obj,
  str,
  var 
)
Value:
do { \
obj->DefineOwnProperty(env->context(), \
OneByteString(env->isolate(), str), \
var, \
v8::ReadOnly).FromJust(); \
} while (0)

Definition at line 3147 of file node.cc.

Referenced by node::SetupProcessObject().

◆ SIGNO_CASE

#define SIGNO_CASE (   e)    case e: return #e;

Referenced by node::signo_string().

◆ V

#define V (   code,
  _,
  __ 
)
Value:
do { \
if (IsReverted(SECURITY_REVERT_ ## code)) { \
READONLY_PROPERTY(process, "REVERT_" #code, True(env->isolate())); \
} \
} while (0);

Referenced by node::SetupProcessObject().

Variable Documentation

◆ environ

char** environ

Referenced by main().