args.GetReturnValue().Set(c++);
}
-extern "C" void init (Handle<Object> target) {
+extern "C" void init (Local<Object> target) {
HandleScope scope(Isolate::GetCurrent());
NODE_SET_METHOD(target, "hello", Hello);
}
namespace node {
inline AsyncWrap::AsyncWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
ProviderType provider,
AsyncWrap* parent)
: BaseObject(env, object), bits_(static_cast<uint32_t>(provider) << 1) {
}
-inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
- const v8::Handle<v8::String> symbol,
+inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
+ const v8::Local<v8::String> symbol,
int argc,
- v8::Handle<v8::Value>* argv) {
+ v8::Local<v8::Value>* argv) {
v8::Local<v8::Value> cb_v = object()->Get(symbol);
CHECK(cb_v->IsFunction());
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
}
-inline v8::Handle<v8::Value> AsyncWrap::MakeCallback(
+inline v8::Local<v8::Value> AsyncWrap::MakeCallback(
uint32_t index,
int argc,
- v8::Handle<v8::Value>* argv) {
+ v8::Local<v8::Value>* argv) {
v8::Local<v8::Value> cb_v = object()->Get(index);
CHECK(cb_v->IsFunction());
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::HeapProfiler;
using v8::Integer;
}
-RetainedObjectInfo* WrapperInfo(uint16_t class_id, Handle<Value> wrapper) {
+RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local<Value> wrapper) {
// No class_id should be the provider type of NONE.
CHECK_NE(NODE_ASYNC_ID_OFFSET, class_id);
CHECK(wrapper->IsObject());
}
-static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Isolate* isolate = env->isolate();
HandleScope scope(isolate);
}
-Handle<Value> AsyncWrap::MakeCallback(const Handle<Function> cb,
+Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
int argc,
- Handle<Value>* argv) {
+ Local<Value>* argv) {
CHECK(env()->context() == env()->isolate()->GetCurrentContext());
Local<Object> context = object();
};
inline AsyncWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
ProviderType provider,
AsyncWrap* parent = nullptr);
inline ProviderType provider_type() const;
// Only call these within a valid HandleScope.
- v8::Handle<v8::Value> MakeCallback(const v8::Handle<v8::Function> cb,
+ v8::Local<v8::Value> MakeCallback(const v8::Local<v8::Function> cb,
int argc,
- v8::Handle<v8::Value>* argv);
- inline v8::Handle<v8::Value> MakeCallback(const v8::Handle<v8::String> symbol,
+ v8::Local<v8::Value>* argv);
+ inline v8::Local<v8::Value> MakeCallback(const v8::Local<v8::String> symbol,
int argc,
- v8::Handle<v8::Value>* argv);
- inline v8::Handle<v8::Value> MakeCallback(uint32_t index,
+ v8::Local<v8::Value>* argv);
+ inline v8::Local<v8::Value> MakeCallback(uint32_t index,
int argc,
- v8::Handle<v8::Value>* argv);
+ v8::Local<v8::Value>* argv);
virtual size_t self_size() const = 0;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
}
-static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
int r = ares_library_init(ARES_LIB_INIT_ALL);
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
class FSEventWrap: public HandleWrap {
public:
- static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context);
+ static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context);
static void New(const FunctionCallbackInfo<Value>& args);
static void Start(const FunctionCallbackInfo<Value>& args);
static void Close(const FunctionCallbackInfo<Value>& args);
size_t self_size() const override { return sizeof(*this); }
private:
- FSEventWrap(Environment* env, Handle<Object> object);
+ FSEventWrap(Environment* env, Local<Object> object);
virtual ~FSEventWrap() override;
static void OnEvent(uv_fs_event_t* handle, const char* filename, int events,
};
-FSEventWrap::FSEventWrap(Environment* env, Handle<Object> object)
+FSEventWrap::FSEventWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
}
-void FSEventWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void FSEventWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
using v8::Context;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::Local;
using v8::Object;
HandleWrap::HandleWrap(Environment* env,
- Handle<Object> object,
+ Local<Object> object,
uv_handle_t* handle,
AsyncWrap::ProviderType provider,
AsyncWrap* parent)
protected:
HandleWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
uv_handle_t* handle,
AsyncWrap::ProviderType provider,
AsyncWrap* parent = nullptr);
using v8::External;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Local;
using v8::Object;
using v8::Value;
-JSStream::JSStream(Environment* env, Handle<Object> obj, AsyncWrap* parent)
+JSStream::JSStream(Environment* env, Local<Object> obj, AsyncWrap* parent)
: StreamBase(env),
AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) {
node::Wrap(obj, this);
}
-void JSStream::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void JSStream::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
class JSStream : public StreamBase, public AsyncWrap {
public:
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
~JSStream();
size_t self_size() const override { return sizeof(*this); }
protected:
- JSStream(Environment* env, v8::Handle<v8::Object> obj, AsyncWrap* parent);
+ JSStream(Environment* env, v8::Local<v8::Object> obj, AsyncWrap* parent);
AsyncWrap* GetAsyncWrap() override;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::HeapStatistics;
using v8::Integer;
}
-Handle<Value> MakeCallback(Environment* env,
- Handle<Value> recv,
- const Handle<Function> callback,
+Local<Value> MakeCallback(Environment* env,
+ Local<Value> recv,
+ const Local<Function> callback,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
// If you hit this assertion, you forgot to enter the v8::Context first.
CHECK_EQ(env->context(), env->isolate()->GetCurrentContext());
// Internal only.
-Handle<Value> MakeCallback(Environment* env,
- Handle<Object> recv,
+Local<Value> MakeCallback(Environment* env,
+ Local<Object> recv,
uint32_t index,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
Local<Value> cb_v = recv->Get(index);
CHECK(cb_v->IsFunction());
return MakeCallback(env, recv.As<Value>(), cb_v.As<Function>(), argc, argv);
}
-Handle<Value> MakeCallback(Environment* env,
- Handle<Object> recv,
- Handle<String> symbol,
+Local<Value> MakeCallback(Environment* env,
+ Local<Object> recv,
+ Local<String> symbol,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
Local<Value> cb_v = recv->Get(symbol);
CHECK(cb_v->IsFunction());
return MakeCallback(env, recv.As<Value>(), cb_v.As<Function>(), argc, argv);
}
-Handle<Value> MakeCallback(Environment* env,
- Handle<Object> recv,
+Local<Value> MakeCallback(Environment* env,
+ Local<Object> recv,
const char* method,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
Local<String> method_string = OneByteString(env->isolate(), method);
return MakeCallback(env, recv, method_string, argc, argv);
}
-Handle<Value> MakeCallback(Isolate* isolate,
- Handle<Object> recv,
+Local<Value> MakeCallback(Isolate* isolate,
+ Local<Object> recv,
const char* method,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
EscapableHandleScope handle_scope(isolate);
Local<Context> context = recv->CreationContext();
Environment* env = Environment::GetCurrent(context);
}
-Handle<Value> MakeCallback(Isolate* isolate,
- Handle<Object> recv,
- Handle<String> symbol,
+Local<Value> MakeCallback(Isolate* isolate,
+ Local<Object> recv,
+ Local<String> symbol,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
EscapableHandleScope handle_scope(isolate);
Local<Context> context = recv->CreationContext();
Environment* env = Environment::GetCurrent(context);
}
-Handle<Value> MakeCallback(Isolate* isolate,
- Handle<Object> recv,
- Handle<Function> callback,
+Local<Value> MakeCallback(Isolate* isolate,
+ Local<Object> recv,
+ Local<Function> callback,
int argc,
- Handle<Value> argv[]) {
+ Local<Value> argv[]) {
EscapableHandleScope handle_scope(isolate);
Local<Context> context = recv->CreationContext();
Environment* env = Environment::GetCurrent(context);
enum encoding ParseEncoding(Isolate* isolate,
- Handle<Value> encoding_v,
+ Local<Value> encoding_v,
enum encoding default_encoding) {
if (!encoding_v->IsString())
return default_encoding;
// Returns -1 if the handle was not valid for decoding
ssize_t DecodeBytes(Isolate* isolate,
- Handle<Value> val,
+ Local<Value> val,
enum encoding encoding) {
HandleScope scope(isolate);
ssize_t DecodeWrite(Isolate* isolate,
char* buf,
size_t buflen,
- Handle<Value> val,
+ Local<Value> val,
enum encoding encoding) {
return StringBytes::Write(isolate, buf, buflen, val, encoding, nullptr);
}
void AppendExceptionLine(Environment* env,
- Handle<Value> er,
- Handle<Message> message) {
+ Local<Value> er,
+ Local<Message> message) {
if (message.IsEmpty())
return;
static void ReportException(Environment* env,
- Handle<Value> er,
- Handle<Message> message) {
+ Local<Value> er,
+ Local<Message> message) {
HandleScope scope(env->isolate());
AppendExceptionLine(env, er, message);
// Executes a str within the current v8 context.
static Local<Value> ExecuteString(Environment* env,
- Handle<String> source,
- Handle<String> filename) {
+ Local<String> source,
+ Local<String> filename) {
EscapableHandleScope scope(env->isolate());
TryCatch try_catch;
#endif
-static uid_t uid_by_name(Isolate* isolate, Handle<Value> value) {
+static uid_t uid_by_name(Isolate* isolate, Local<Value> value) {
if (value->IsUint32()) {
return static_cast<uid_t>(value->Uint32Value());
} else {
}
-static gid_t gid_by_name(Isolate* isolate, Handle<Value> value) {
+static gid_t gid_by_name(Isolate* isolate, Local<Value> value) {
if (value->IsUint32()) {
return static_cast<gid_t>(value->Uint32Value());
} else {
return mp;
}
-typedef void (UV_DYNAMIC* extInit)(Handle<Object> exports);
+typedef void (UV_DYNAMIC* extInit)(Local<Object> exports);
// DLOpen is process.dlopen(module, filename).
// Used to load 'module.node' dynamically shared objects.
void FatalException(Isolate* isolate,
- Handle<Value> error,
- Handle<Message> message) {
+ Local<Value> error,
+ Local<Message> message) {
HandleScope scope(isolate);
Environment* env = Environment::GetCurrent(isolate);
}
-void OnMessage(Handle<Message> message, Handle<Value> error) {
+void OnMessage(Local<Message> message, Local<Value> error) {
// The current version of V8 sends messages for errors only
// (thus `error` is always set).
FatalException(Isolate::GetCurrent(), error, message);
}
-static Handle<Object> GetFeatures(Environment* env) {
+static Local<Object> GetFeatures(Environment* env) {
EscapableHandleScope scope(env->isolate());
Local<Object> obj = Object::New(env->isolate());
Local<Object> process_object = env->process_object();
process_object->Set(env->exiting_string(), True(env->isolate()));
- Handle<String> exitCode = env->exit_code_string();
+ Local<String> exitCode = env->exit_code_string();
int code = process_object->Get(exitCode)->Int32Value();
Local<Value> args[] = {
// Just a convenience method
Environment* CreateEnvironment(Isolate* isolate,
- Handle<Context> context,
+ Local<Context> context,
int argc,
const char* const* argv,
int exec_argc,
}
static Environment* CreateEnvironment(Isolate* isolate,
- Handle<Context> context,
+ Local<Context> context,
NodeInstanceData* instance_data) {
return CreateEnvironment(isolate,
instance_data->event_loop(),
Environment* CreateEnvironment(Isolate* isolate,
uv_loop_t* loop,
- Handle<Context> context,
+ Local<Context> context,
int argc,
const char* const* argv,
int exec_argc,
* cb, you will appear to leak 4-bytes for every invocation. Take heed.
*/
-NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
+NODE_EXTERN v8::Local<v8::Value> MakeCallback(
v8::Isolate* isolate,
- v8::Handle<v8::Object> recv,
+ v8::Local<v8::Object> recv,
const char* method,
int argc,
- v8::Handle<v8::Value>* argv);
-NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
+ v8::Local<v8::Value>* argv);
+NODE_EXTERN v8::Local<v8::Value> MakeCallback(
v8::Isolate* isolate,
- v8::Handle<v8::Object> recv,
- v8::Handle<v8::String> symbol,
+ v8::Local<v8::Object> recv,
+ v8::Local<v8::String> symbol,
int argc,
- v8::Handle<v8::Value>* argv);
-NODE_EXTERN v8::Handle<v8::Value> MakeCallback(
+ v8::Local<v8::Value>* argv);
+NODE_EXTERN v8::Local<v8::Value> MakeCallback(
v8::Isolate* isolate,
- v8::Handle<v8::Object> recv,
- v8::Handle<v8::Function> callback,
+ v8::Local<v8::Object> recv,
+ v8::Local<v8::Function> callback,
int argc,
- v8::Handle<v8::Value>* argv);
+ v8::Local<v8::Value>* argv);
} // namespace node
NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate,
struct uv_loop_s* loop,
- v8::Handle<v8::Context> context,
+ v8::Local<v8::Context> context,
int argc,
const char* const* argv,
int exec_argc,
// CreateEnvironment() + LoadEnvironment() from above.
// `uv_default_loop()` will be passed as `loop`.
NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate,
- v8::Handle<v8::Context> context,
+ v8::Local<v8::Context> context,
int argc,
const char* const* argv,
int exec_argc,
// Used to be a macro, hence the uppercase name.
// Not a template because it only makes sense for FunctionTemplates.
-inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle<v8::FunctionTemplate> recv,
+inline void NODE_SET_PROTOTYPE_METHOD(v8::Local<v8::FunctionTemplate> recv,
const char* name,
v8::FunctionCallback callback) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate);
- v8::Handle<v8::Signature> s = v8::Signature::New(isolate, recv);
+ v8::Local<v8::Signature> s = v8::Signature::New(isolate, recv);
v8::Local<v8::FunctionTemplate> t =
- v8::FunctionTemplate::New(isolate, callback, v8::Handle<v8::Value>(), s);
+ v8::FunctionTemplate::New(isolate, callback, v8::Local<v8::Value>(), s);
v8::Local<v8::Function> fn = t->GetFunction();
recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), fn);
v8::Local<v8::String> fn_name = v8::String::NewFromUtf8(isolate, name);
enum encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER};
NODE_EXTERN enum encoding ParseEncoding(
v8::Isolate* isolate,
- v8::Handle<v8::Value> encoding_v,
+ v8::Local<v8::Value> encoding_v,
enum encoding default_encoding = BINARY);
NODE_DEPRECATED("Use ParseEncoding(isolate, ...)",
inline enum encoding ParseEncoding(
- v8::Handle<v8::Value> encoding_v,
+ v8::Local<v8::Value> encoding_v,
enum encoding default_encoding = BINARY) {
return ParseEncoding(v8::Isolate::GetCurrent(), encoding_v, default_encoding);
})
// Returns -1 if the handle was not valid for decoding
NODE_EXTERN ssize_t DecodeBytes(v8::Isolate* isolate,
- v8::Handle<v8::Value>,
+ v8::Local<v8::Value>,
enum encoding encoding = BINARY);
NODE_DEPRECATED("Use DecodeBytes(isolate, ...)",
inline ssize_t DecodeBytes(
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
enum encoding encoding = BINARY) {
return DecodeBytes(v8::Isolate::GetCurrent(), val, encoding);
})
NODE_EXTERN ssize_t DecodeWrite(v8::Isolate* isolate,
char* buf,
size_t buflen,
- v8::Handle<v8::Value>,
+ v8::Local<v8::Value>,
enum encoding encoding = BINARY);
NODE_DEPRECATED("Use DecodeWrite(isolate, ...)",
inline ssize_t DecodeWrite(char* buf,
size_t buflen,
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
enum encoding encoding = BINARY) {
return DecodeWrite(v8::Isolate::GetCurrent(), buf, buflen, val, encoding);
})
typedef void (*addon_register_func)(
- v8::Handle<v8::Object> exports,
- v8::Handle<v8::Value> module,
+ v8::Local<v8::Object> exports,
+ v8::Local<v8::Value> module,
void* priv);
typedef void (*addon_context_register_func)(
- v8::Handle<v8::Object> exports,
- v8::Handle<v8::Value> module,
- v8::Handle<v8::Context> context,
+ v8::Local<v8::Object> exports,
+ v8::Local<v8::Value> module,
+ v8::Local<v8::Context> context,
void* priv);
#define NM_F_BUILTIN 0x01
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
public:
static inline void Free(char* data, void* hint);
static inline CallbackInfo* New(Isolate* isolate,
- Handle<Object> object,
+ Local<Object> object,
FreeCallback callback,
void* hint = 0);
inline void Dispose(Isolate* isolate);
static void WeakCallback(const WeakCallbackData<Object, CallbackInfo>&);
inline void WeakCallback(Isolate* isolate, Local<Object> object);
inline CallbackInfo(Isolate* isolate,
- Handle<Object> object,
+ Local<Object> object,
FreeCallback callback,
void* hint);
~CallbackInfo();
CallbackInfo* CallbackInfo::New(Isolate* isolate,
- Handle<Object> object,
+ Local<Object> object,
FreeCallback callback,
void* hint) {
return new CallbackInfo(isolate, object, callback, hint);
CallbackInfo::CallbackInfo(Isolate* isolate,
- Handle<Object> object,
+ Local<Object> object,
FreeCallback callback,
void* hint)
: persistent_(isolate, object),
// Buffer methods
-bool HasInstance(Handle<Value> val) {
+bool HasInstance(Local<Value> val) {
return val->IsObject() && HasInstance(val.As<Object>());
}
-bool HasInstance(Handle<Object> obj) {
+bool HasInstance(Local<Object> obj) {
if (!obj->IsUint8Array())
return false;
Local<Uint8Array> array = obj.As<Uint8Array>();
}
-char* Data(Handle<Value> val) {
+char* Data(Local<Value> val) {
CHECK(val->IsObject());
// Use a fully qualified name here to work around a bug in gcc 4.2.
// It mistakes an unadorned call to Data() for the v8::String::Data type.
}
-char* Data(Handle<Object> obj) {
+char* Data(Local<Object> obj) {
CHECK(obj->IsUint8Array());
Local<Uint8Array> ui = obj.As<Uint8Array>();
ArrayBuffer::Contents ab_c = ui->Buffer()->GetContents();
}
-size_t Length(Handle<Value> val) {
+size_t Length(Local<Value> val) {
CHECK(val->IsObject());
return Length(val.As<Object>());
}
-size_t Length(Handle<Object> obj) {
+size_t Length(Local<Object> obj) {
CHECK(obj->IsUint8Array());
Local<Uint8Array> ui = obj.As<Uint8Array>();
return ui->ByteLength();
}
-void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "setupBufferJS", SetupBufferJS);
NODE_EXTERN typedef void (*FreeCallback)(char* data, void* hint);
-NODE_EXTERN bool HasInstance(v8::Handle<v8::Value> val);
-NODE_EXTERN bool HasInstance(v8::Handle<v8::Object> val);
-NODE_EXTERN char* Data(v8::Handle<v8::Value> val);
-NODE_EXTERN char* Data(v8::Handle<v8::Object> val);
-NODE_EXTERN size_t Length(v8::Handle<v8::Value> val);
-NODE_EXTERN size_t Length(v8::Handle<v8::Object> val);
+NODE_EXTERN bool HasInstance(v8::Local<v8::Value> val);
+NODE_EXTERN bool HasInstance(v8::Local<v8::Object> val);
+NODE_EXTERN char* Data(v8::Local<v8::Value> val);
+NODE_EXTERN char* Data(v8::Local<v8::Object> val);
+NODE_EXTERN size_t Length(v8::Local<v8::Value> val);
+NODE_EXTERN size_t Length(v8::Local<v8::Object> val);
// public constructor - data is copied
NODE_EXTERN v8::MaybeLocal<v8::Object> Copy(v8::Isolate* isolate,
// public constructor from string
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
- v8::Handle<v8::String> string,
+ v8::Local<v8::String> string,
enum encoding enc = UTF8);
// public constructor - data is used, callback is passed data on object gc
namespace node {
-using v8::Handle;
+using v8::Local;
using v8::Object;
#if HAVE_OPENSSL
const char* default_cipher_list = DEFAULT_CIPHER_LIST_CORE;
#endif
-void DefineErrnoConstants(Handle<Object> target) {
+void DefineErrnoConstants(Local<Object> target) {
#ifdef E2BIG
NODE_DEFINE_CONSTANT(target, E2BIG);
#endif
#endif
}
-void DefineWindowsErrorConstants(Handle<Object> target) {
+void DefineWindowsErrorConstants(Local<Object> target) {
#ifdef WSAEINTR
NODE_DEFINE_CONSTANT(target, WSAEINTR);
#endif
#endif
}
-void DefineSignalConstants(Handle<Object> target) {
+void DefineSignalConstants(Local<Object> target) {
#ifdef SIGHUP
NODE_DEFINE_CONSTANT(target, SIGHUP);
#endif
#endif
}
-void DefineOpenSSLConstants(Handle<Object> target) {
+void DefineOpenSSLConstants(Local<Object> target) {
#ifdef SSL_OP_ALL
NODE_DEFINE_CONSTANT(target, SSL_OP_ALL);
#endif
#endif
}
-void DefineSystemConstants(Handle<Object> target) {
+void DefineSystemConstants(Local<Object> target) {
// file access modes
NODE_DEFINE_CONSTANT(target, O_RDONLY);
NODE_DEFINE_CONSTANT(target, O_WRONLY);
#endif
}
-void DefineUVConstants(Handle<Object> target) {
+void DefineUVConstants(Local<Object> target) {
NODE_DEFINE_CONSTANT(target, UV_UDP_REUSEADDR);
}
-void DefineCryptoConstants(Handle<Object> target) {
+void DefineCryptoConstants(Local<Object> target) {
#if HAVE_OPENSSL
NODE_DEFINE_STRING_CONSTANT(target,
"defaultCoreCipherList",
#endif
}
-void DefineConstants(Handle<Object> target) {
+void DefineConstants(Local<Object> target) {
DefineErrnoConstants(target);
DefineWindowsErrorConstants(target);
DefineSignalConstants(target);
extern const char* default_cipher_list;
#endif
-void DefineConstants(v8::Handle<v8::Object> target);
+void DefineConstants(v8::Local<v8::Object> target);
} // namespace node
#endif // SRC_NODE_CONSTANTS_H_
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
Local<Object> wrapper =
env->script_data_constructor_function()->NewInstance();
if (wrapper.IsEmpty())
- return scope.Escape(Local<Value>::New(env->isolate(), Handle<Value>()));
+ return scope.Escape(Local<Value>::New(env->isolate(), Local<Value>()));
Wrap(wrapper, this);
return scope.Escape(wrapper);
};
-void InitContextify(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void InitContextify(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
ContextifyContext::Init(env, target);
ContextifyScript::Init(env, target);
using v8::GCEpilogueCallback;
using v8::GCPrologueCallback;
using v8::GCType;
-using v8::Handle;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
}
-void InitPerfCounters(Environment* env, Handle<Object> target) {
+void InitPerfCounters(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
static struct {
}
-void TermPerfCounters(Handle<Object> target) {
+void TermPerfCounters(Local<Object> target) {
// Only Windows performance counters supported
// To enable other OS, use conditional compilation here
TermPerfCountersWin32();
namespace node {
-void InitPerfCounters(Environment* env, v8::Handle<v8::Object> target);
-void TermPerfCounters(v8::Handle<v8::Object> target);
+void InitPerfCounters(Environment* env, v8::Local<v8::Object> target);
+void TermPerfCounters(v8::Local<v8::Object> target);
} // namespace node
using v8::False;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
// Just to generate static methods
template class SSLWrap<TLSWrap>;
template void SSLWrap<TLSWrap>::AddMethods(Environment* env,
- Handle<FunctionTemplate> t);
+ Local<FunctionTemplate> t);
template void SSLWrap<TLSWrap>::InitNPN(SecureContext* sc);
template SSL_SESSION* SSLWrap<TLSWrap>::GetSessionCallback(
SSL* s,
}
-void SecureContext::Initialize(Environment* env, Handle<Object> target) {
+void SecureContext::Initialize(Environment* env, Local<Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(SecureContext::New);
t->InstanceTemplate()->SetInternalFieldCount(1);
t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "SecureContext"));
// Takes a string or buffer and loads it into a BIO.
// Caller responsible for BIO_free_all-ing the returned object.
-static BIO* LoadBIO(Environment* env, Handle<Value> v) {
+static BIO* LoadBIO(Environment* env, Local<Value> v) {
BIO* bio = NodeBIO::New();
if (!bio)
return nullptr;
// Takes a string or buffer and loads it into an X509
// Caller responsible for X509_free-ing the returned object.
-static X509* LoadX509(Environment* env, Handle<Value> v) {
+static X509* LoadX509(Environment* env, Local<Value> v) {
HandleScope scope(env->isolate());
BIO *bio = LoadBIO(env, v);
template <class Base>
-void SSLWrap<Base>::AddMethods(Environment* env, Handle<FunctionTemplate> t) {
+void SSLWrap<Base>::AddMethods(Environment* env, Local<FunctionTemplate> t) {
HandleScope scope(env->isolate());
env->SetProtoMethod(t, "getPeerCertificate", GetPeerCertificate);
size_t len = Buffer::Length(obj);
int status = SSL_select_next_proto(out, outlen, in, inlen, npn_protos, len);
- Handle<Value> result;
+ Local<Value> result;
switch (status) {
case OPENSSL_NPN_UNSUPPORTED:
result = Null(env->isolate());
}
-void Connection::Initialize(Environment* env, Handle<Object> target) {
+void Connection::Initialize(Environment* env, Local<Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(Connection::New);
t->InstanceTemplate()->SetInternalFieldCount(1);
t->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Connection"));
#endif
-void CipherBase::Initialize(Environment* env, Handle<Object> target) {
+void CipherBase::Initialize(Environment* env, Local<Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(1);
}
-void Hmac::Initialize(Environment* env, v8::Handle<v8::Object> target) {
+void Hmac::Initialize(Environment* env, v8::Local<v8::Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(1);
}
-void Hash::Initialize(Environment* env, v8::Handle<v8::Object> target) {
+void Hash::Initialize(Environment* env, v8::Local<v8::Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(1);
-void Sign::Initialize(Environment* env, v8::Handle<v8::Object> target) {
+void Sign::Initialize(Environment* env, v8::Local<v8::Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(1);
}
-void Verify::Initialize(Environment* env, v8::Handle<v8::Object> target) {
+void Verify::Initialize(Environment* env, v8::Local<v8::Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
t->InstanceTemplate()->SetInternalFieldCount(1);
}
-void DiffieHellman::Initialize(Environment* env, Handle<Object> target) {
+void DiffieHellman::Initialize(Environment* env, Local<Object> target) {
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
const PropertyAttribute attributes =
}
-void ECDH::Initialize(Environment* env, Handle<Object> target) {
+void ECDH::Initialize(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
}
-void Certificate::Initialize(Environment* env, Handle<Object> target) {
+void Certificate::Initialize(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
// FIXME(bnoordhuis) Handle global init correctly.
-void InitCrypto(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context,
+void InitCrypto(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context,
void* priv) {
static uv_once_t init_once = UV_ONCE_INIT;
uv_once(&init_once, InitCryptoOnce);
FreeCTXMem();
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
X509_STORE* ca_store_;
SSL_CTX* ctx_;
sizeof(SSL) + sizeof(SSL3_STATE) + 42 * 1024;
static void InitNPN(SecureContext* sc);
- static void AddMethods(Environment* env, v8::Handle<v8::FunctionTemplate> t);
+ static void AddMethods(Environment* env, v8::Local<v8::FunctionTemplate> t);
static SSL_SESSION* GetSessionCallback(SSL* s,
unsigned char* key,
#endif
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
void NewSessionDoneCb();
#ifdef OPENSSL_NPN_NEGOTIATED
EVP_CIPHER_CTX_cleanup(&ctx_);
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
protected:
enum CipherKind {
HMAC_CTX_cleanup(&ctx_);
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
protected:
void HmacInit(const char* hash_type, const char* key, int key_len);
EVP_MD_CTX_cleanup(&mdctx_);
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
bool HashInit(const char* hash_type);
bool HashUpdate(const char* data, int len);
class Sign : public SignBase {
public:
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
Error SignInit(const char* sign_type);
Error SignUpdate(const char* data, int len);
class Verify : public SignBase {
public:
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
Error VerifyInit(const char* verify_type);
Error VerifyUpdate(const char* data, int len);
}
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
bool Init(int primeLength, int g);
bool Init(const char* p, int p_len, int g);
group_ = nullptr;
}
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
protected:
ECDH(Environment* env, v8::Local<v8::Object> wrap, EC_KEY* key)
class Certificate : public AsyncWrap {
public:
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
- v8::Handle<v8::Value> CertificateInit(const char* sign_type);
+ v8::Local<v8::Value> CertificateInit(const char* sign_type);
bool VerifySpkac(const char* data, unsigned int len);
const char* ExportPublicKey(const char* data, int len);
const char* ExportChallenge(const char* data, int len);
#ifndef OPENSSL_NO_ENGINE
void SetEngine(const v8::FunctionCallbackInfo<v8::Value>& args);
#endif // !OPENSSL_NO_ENGINE
-void InitCrypto(v8::Handle<v8::Object> target);
+void InitCrypto(v8::Local<v8::Object> target);
} // namespace crypto
} // namespace node
using v8::GCEpilogueCallback;
using v8::GCPrologueCallback;
using v8::GCType;
-using v8::Handle;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
}
-void InitDTrace(Environment* env, Handle<Object> target) {
+void InitDTrace(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
static struct {
namespace node {
-void InitDTrace(Environment* env, v8::Handle<v8::Object> target);
+void InitDTrace(Environment* env, v8::Local<v8::Object> target);
} // namespace node
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
env->set_fs_stats_constructor_function(stats_constructor);
}
-void InitFs(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context,
+void InitFs(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
namespace node {
-void InitFs(v8::Handle<v8::Object> target);
+void InitFs(v8::Local<v8::Object> target);
} // namespace node
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
};
-void InitHttpParser(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context,
+void InitHttpParser(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(Parser::New);
namespace node {
-void InitHttpParser(v8::Handle<v8::Object> target);
+void InitHttpParser(v8::Local<v8::Object> target);
} // namespace node
const v8::Persistent<TypeName>& persistent);
// Call with valid HandleScope and while inside Context scope.
-v8::Handle<v8::Value> MakeCallback(Environment* env,
- v8::Handle<v8::Object> recv,
+v8::Local<v8::Value> MakeCallback(Environment* env,
+ v8::Local<v8::Object> recv,
const char* method,
int argc = 0,
- v8::Handle<v8::Value>* argv = nullptr);
+ v8::Local<v8::Value>* argv = nullptr);
// Call with valid HandleScope and while inside Context scope.
-v8::Handle<v8::Value> MakeCallback(Environment* env,
- v8::Handle<v8::Object> recv,
+v8::Local<v8::Value> MakeCallback(Environment* env,
+ v8::Local<v8::Object> recv,
uint32_t index,
int argc = 0,
- v8::Handle<v8::Value>* argv = nullptr);
+ v8::Local<v8::Value>* argv = nullptr);
// Call with valid HandleScope and while inside Context scope.
-v8::Handle<v8::Value> MakeCallback(Environment* env,
- v8::Handle<v8::Object> recv,
- v8::Handle<v8::String> symbol,
+v8::Local<v8::Value> MakeCallback(Environment* env,
+ v8::Local<v8::Object> recv,
+ v8::Local<v8::String> symbol,
int argc = 0,
- v8::Handle<v8::Value>* argv = nullptr);
+ v8::Local<v8::Value>* argv = nullptr);
// Call with valid HandleScope and while inside Context scope.
-v8::Handle<v8::Value> MakeCallback(Environment* env,
- v8::Handle<v8::Value> recv,
- v8::Handle<v8::Function> callback,
+v8::Local<v8::Value> MakeCallback(Environment* env,
+ v8::Local<v8::Value> recv,
+ v8::Local<v8::Function> callback,
int argc = 0,
- v8::Handle<v8::Value>* argv = nullptr);
+ v8::Local<v8::Value>* argv = nullptr);
bool KickNextTick();
v8::Local<v8::Object> AddressToJS(
Environment* env,
const sockaddr* addr,
- v8::Local<v8::Object> info = v8::Handle<v8::Object>());
+ v8::Local<v8::Object> info = v8::Local<v8::Object>());
template <typename T, int (*F)(const typename T::HandleType*, sockaddr*, int*)>
void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>& args) {
#endif
void AppendExceptionLine(Environment* env,
- v8::Handle<v8::Value> er,
- v8::Handle<v8::Message> message);
+ v8::Local<v8::Value> er,
+ v8::Local<v8::Message> message);
NO_RETURN void FatalError(const char* location, const char* message);
}
// parse index for external array data
-inline MUST_USE_RESULT bool ParseArrayIndex(v8::Handle<v8::Value> arg,
+inline MUST_USE_RESULT bool ParseArrayIndex(v8::Local<v8::Value> arg,
size_t def,
size_t* ret) {
if (arg->IsUndefined()) {
namespace node {
-using v8::Handle;
using v8::HandleScope;
using v8::Local;
using v8::Object;
using v8::String;
-Handle<String> MainSource(Environment* env) {
+Local<String> MainSource(Environment* env) {
return OneByteString(env->isolate(), node_native, sizeof(node_native) - 1);
}
-void DefineJavaScript(Environment* env, Handle<Object> target) {
+void DefineJavaScript(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
for (int i = 0; natives[i].name; i++) {
if (natives[i].source != node_native) {
Local<String> name = String::NewFromUtf8(env->isolate(), natives[i].name);
- Handle<String> source = String::NewFromUtf8(env->isolate(),
+ Local<String> source = String::NewFromUtf8(env->isolate(),
natives[i].source,
String::kNormalString,
natives[i].source_len);
namespace node {
-void DefineJavaScript(Environment* env, v8::Handle<v8::Object> target);
-v8::Handle<v8::String> MainSource(Environment* env);
+void DefineJavaScript(Environment* env, v8::Local<v8::Object> target);
+v8::Local<v8::String> MainSource(Environment* env);
} // namespace node
using v8::GCEpilogueCallback;
using v8::GCPrologueCallback;
using v8::GCType;
-using v8::Handle;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
NODE_GC_DONE(type, flags, isolate);
}
-void InitLTTNG(Environment* env, Handle<Object> target) {
+void InitLTTNG(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
static struct {
namespace node {
-void InitLTTNG(Environment* env, v8::Handle<v8::Object> target);
+void InitLTTNG(Environment* env, v8::Local<v8::Object> target);
} // namespace node
template <class T>
- static inline T* Unwrap(v8::Handle<v8::Object> handle) {
+ static inline T* Unwrap(v8::Local<v8::Object> handle) {
assert(!handle.IsEmpty());
assert(handle->InternalFieldCount() > 0);
// Cast to ObjectWrap before casting to T. A direct cast from void
protected:
- inline void Wrap(v8::Handle<v8::Object> handle) {
+ inline void Wrap(v8::Local<v8::Object> handle) {
assert(persistent().IsEmpty());
assert(handle->InternalFieldCount() > 0);
handle->SetAlignedPointerInInternalField(0, this);
using v8::Boolean;
using v8::Context;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::Integer;
using v8::Local;
using v8::Number;
}
-void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "getHostname", GetHostname);
env->SetMethod(target, "getLoadAvg", GetLoadAvg);
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Value;
-void StatWatcher::Initialize(Environment* env, Handle<Object> target) {
+void StatWatcher::Initialize(Environment* env, Local<Object> target) {
HandleScope scope(env->isolate());
Local<FunctionTemplate> t = env->NewFunctionTemplate(StatWatcher::New);
public:
virtual ~StatWatcher() override;
- static void Initialize(Environment* env, v8::Handle<v8::Object> target);
+ static void Initialize(Environment* env, v8::Local<v8::Object> target);
protected:
StatWatcher(Environment* env, v8::Local<v8::Object> wrap);
using v8::Context;
using v8::Function;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HeapStatistics;
using v8::Isolate;
using v8::Local;
}
-void InitializeV8Bindings(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void InitializeV8Bindings(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target,
"updateHeapStatisticsArrayBuffer",
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
};
-void InitZlib(v8::Handle<v8::Object> target);
+void InitZlib(v8::Local<v8::Object> target);
/**
};
-void InitZlib(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context,
+void InitZlib(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> z = env->NewFunctionTemplate(ZCtx::New);
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
}
-void PipeWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void PipeWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
PipeWrap::PipeWrap(Environment* env,
- Handle<Object> object,
+ Local<Object> object,
bool ipc,
AsyncWrap* parent)
: StreamWrap(env,
uv_pipe_t* UVHandle();
static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
size_t self_size() const override { return sizeof(*this); }
private:
PipeWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
bool ipc,
AsyncWrap* parent);
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
class ProcessWrap : public HandleWrap {
public:
- static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+ static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> constructor = env->NewFunctionTemplate(New);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
new ProcessWrap(env, args.This());
}
- ProcessWrap(Environment* env, Handle<Object> object)
+ ProcessWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&process_),
template <typename T>
ReqWrap<T>::ReqWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
AsyncWrap::ProviderType provider)
: AsyncWrap(env, object, provider) {
if (env->in_domain())
class ReqWrap : public AsyncWrap {
public:
inline ReqWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
AsyncWrap::ProviderType provider);
inline ~ReqWrap() override;
inline void Dispatched(); // Call this after the req has been dispatched.
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
class SignalWrap : public HandleWrap {
public:
- static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+ static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> constructor = env->NewFunctionTemplate(New);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
new SignalWrap(env, args.This());
}
- SignalWrap(Environment* env, Handle<Object> object)
+ SignalWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
using v8::Context;
using v8::EscapableHandleScope;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
}
-void SyncProcessRunner::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void SyncProcessRunner::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "spawn", Spawn);
}
using v8::Array;
using v8::Context;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
};
public:
- static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context);
+ static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context);
static void Spawn(const FunctionCallbackInfo<Value>& args);
private:
using v8::External;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Local;
using v8::Object;
template <class Base>
void StreamBase::AddMethods(Environment* env,
- Handle<FunctionTemplate> t,
+ Local<FunctionTemplate> t,
int flags) {
HandleScope scope(env->isolate());
using v8::Array;
using v8::Context;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
for (size_t i = 0; i < count; i++) {
storage_size = ROUND_UP(storage_size, WriteWrap::kAlignSize);
- Handle<Value> chunk = chunks->Get(i * 2);
+ Local<Value> chunk = chunks->Get(i * 2);
if (Buffer::HasInstance(chunk))
continue;
// Buffer chunk, no additional storage required
// String chunk
- Handle<String> string = chunk->ToString(env->isolate());
+ Local<String> string = chunk->ToString(env->isolate());
enum encoding encoding = ParseEncoding(env->isolate(),
chunks->Get(i * 2 + 1));
size_t chunk_size;
uint32_t bytes = 0;
size_t offset = 0;
for (size_t i = 0; i < count; i++) {
- Handle<Value> chunk = chunks->Get(i * 2);
+ Local<Value> chunk = chunks->Get(i * 2);
// Write buffer
if (Buffer::HasInstance(chunk)) {
char* str_storage = req_wrap->Extra(offset);
size_t str_size = storage_size - offset;
- Handle<String> string = chunk->ToString(env->isolate());
+ Local<String> string = chunk->ToString(env->isolate());
enum encoding encoding = ParseEncoding(env->isolate(),
chunks->Get(i * 2 + 1));
str_size = StringBytes::Write(env->isolate(),
template <class Base>
static inline void AddMethods(Environment* env,
- v8::Handle<v8::FunctionTemplate> target,
+ v8::Local<v8::FunctionTemplate> target,
int flags = kFlagNone);
virtual void* Cast() = 0;
using v8::EscapableHandleScope;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
using v8::Value;
-void StreamWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void StreamWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> sw =
void StreamWrap::AddMethods(Environment* env,
- v8::Handle<v8::FunctionTemplate> target,
+ v8::Local<v8::FunctionTemplate> target,
int flags) {
env->SetProtoMethod(target, "setBlocking", SetBlocking);
StreamBase::AddMethods<StreamWrap>(env, target, flags);
class StreamWrap : public HandleWrap, public StreamBase {
public:
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
int GetFD() override;
void* Cast() override;
void UpdateWriteQueueSize();
static void AddMethods(Environment* env,
- v8::Handle<v8::FunctionTemplate> target,
+ v8::Local<v8::FunctionTemplate> target,
int flags = StreamBase::kFlagNone);
private:
namespace node {
using v8::EscapableHandleScope;
-using v8::Handle;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
bool StringBytes::GetExternalParts(Isolate* isolate,
- Handle<Value> val,
+ Local<Value> val,
const char** data,
size_t* len) {
if (Buffer::HasInstance(val)) {
size_t StringBytes::Write(Isolate* isolate,
char* buf,
size_t buflen,
- Handle<Value> val,
+ Local<Value> val,
enum encoding encoding,
int* chars_written) {
HandleScope scope(isolate);
bool StringBytes::IsValidString(Isolate* isolate,
- Handle<String> string,
+ Local<String> string,
enum encoding enc) {
if (enc == HEX && string->Length() % 2 != 0)
return false;
// Will always be at least big enough, but may have some extra
// UTF8 can be as much as 3x the size, Base64 can have 1-2 extra bytes
size_t StringBytes::StorageSize(Isolate* isolate,
- Handle<Value> val,
+ Local<Value> val,
enum encoding encoding) {
HandleScope scope(isolate);
size_t data_size = 0;
size_t StringBytes::Size(Isolate* isolate,
- Handle<Value> val,
+ Local<Value> val,
enum encoding encoding) {
HandleScope scope(isolate);
size_t data_size = 0;
#ifndef SRC_STRING_BYTES_H_
#define SRC_STRING_BYTES_H_
-// Decodes a v8::Handle<v8::String> or Buffer to a raw char*
+// Decodes a v8::Local<v8::String> or Buffer to a raw char*
#include "v8.h"
#include "node.h"
}
inline bool Decode(Environment* env,
- v8::Handle<v8::String> string,
- v8::Handle<v8::Value> encoding,
+ v8::Local<v8::String> string,
+ v8::Local<v8::Value> encoding,
enum encoding _default) {
enum encoding enc = ParseEncoding(env->isolate(), encoding, _default);
if (!StringBytes::IsValidString(env->isolate(), string, enc)) {
// Example: a HEX string must have a length that's a multiple of two.
// FIXME(bnoordhuis) IsMaybeValidString()? Naming things is hard...
static bool IsValidString(v8::Isolate* isolate,
- v8::Handle<v8::String> string,
+ v8::Local<v8::String> string,
enum encoding enc);
// Fast, but can be 2 bytes oversized for Base64, and
// as much as triple UTF-8 strings <= 65536 chars in length
static size_t StorageSize(v8::Isolate* isolate,
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
enum encoding enc);
// Precise byte count, but slightly slower for Base64 and
// very much slower for UTF-8
static size_t Size(v8::Isolate* isolate,
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
enum encoding enc);
// If the string is external then assign external properties to data and len,
// then return true. If not return false.
static bool GetExternalParts(v8::Isolate* isolate,
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
const char** data,
size_t* len);
static size_t Write(v8::Isolate* isolate,
char* buf,
size_t buflen,
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
enum encoding enc,
int* chars_written = nullptr);
NODE_DEPRECATED("Use IsValidString(isolate, ...)",
static inline bool IsValidString(
- v8::Handle<v8::String> string,
+ v8::Local<v8::String> string,
enum encoding enc) {
return IsValidString(v8::Isolate::GetCurrent(), string, enc);
})
NODE_DEPRECATED("Use StorageSize(isolate, ...)",
- static inline size_t StorageSize(v8::Handle<v8::Value> val,
+ static inline size_t StorageSize(v8::Local<v8::Value> val,
enum encoding enc) {
return StorageSize(v8::Isolate::GetCurrent(), val, enc);
})
NODE_DEPRECATED("Use Size(isolate, ...)",
- static inline size_t Size(v8::Handle<v8::Value> val,
+ static inline size_t Size(v8::Local<v8::Value> val,
enum encoding enc) {
return Size(v8::Isolate::GetCurrent(), val, enc);
})
NODE_DEPRECATED("Use GetExternalParts(isolate, ...)",
- static inline bool GetExternalParts(v8::Handle<v8::Value> val,
+ static inline bool GetExternalParts(v8::Local<v8::Value> val,
const char** data,
size_t* len) {
return GetExternalParts(v8::Isolate::GetCurrent(), val, data, len);
NODE_DEPRECATED("Use Write(isolate, ...)",
static inline size_t Write(char* buf,
size_t buflen,
- v8::Handle<v8::Value> val,
+ v8::Local<v8::Value> val,
enum encoding enc,
int* chars_written = nullptr) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
}
-void TCPWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void TCPWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
}
-TCPWrap::TCPWrap(Environment* env, Handle<Object> object, AsyncWrap* parent)
+TCPWrap::TCPWrap(Environment* env, Local<Object> object, AsyncWrap* parent)
: StreamWrap(env,
object,
reinterpret_cast<uv_stream_t*>(&handle_),
class TCPWrap : public StreamWrap {
public:
static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
uv_tcp_t* UVHandle();
int (*F)(const typename T::HandleType*, sockaddr*, int*)>
friend void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>&);
- TCPWrap(Environment* env, v8::Handle<v8::Object> object, AsyncWrap* parent);
+ TCPWrap(Environment* env, v8::Local<v8::Object> object, AsyncWrap* parent);
~TCPWrap();
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
class TimerWrap : public HandleWrap {
public:
- static void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+ static void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> constructor = env->NewFunctionTemplate(New);
constructor->InstanceTemplate()->SetInternalFieldCount(1);
new TimerWrap(env, args.This());
}
- TimerWrap(Environment* env, Handle<Object> object)
+ TimerWrap(Environment* env, Local<Object> object)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::Integer;
using v8::Local;
using v8::Null;
#endif // SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
-void TLSWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void TLSWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
env->SetMethod(target, "wrap", TLSWrap::Wrap);
public:
~TLSWrap() override;
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
void* Cast() override;
int GetFD() override;
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::Integer;
using v8::Local;
using v8::Object;
using v8::Value;
-void TTYWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void TTYWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
}
-TTYWrap::TTYWrap(Environment* env, Handle<Object> object, int fd, bool readable)
+TTYWrap::TTYWrap(Environment* env, Local<Object> object, int fd, bool readable)
: StreamWrap(env,
object,
reinterpret_cast<uv_stream_t*>(&handle_),
class TTYWrap : public StreamWrap {
public:
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
uv_tty_t* UVHandle();
private:
TTYWrap(Environment* env,
- v8::Handle<v8::Object> object,
+ v8::Local<v8::Object> object,
int fd,
bool readable);
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Local;
}
-UDPWrap::UDPWrap(Environment* env, Handle<Object> object, AsyncWrap* parent)
+UDPWrap::UDPWrap(Environment* env, Local<Object> object, AsyncWrap* parent)
: HandleWrap(env,
object,
reinterpret_cast<uv_handle_t*>(&handle_),
}
-void UDPWrap::Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void UDPWrap::Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
Local<FunctionTemplate> t = env->NewFunctionTemplate(New);
class UDPWrap: public HandleWrap {
public:
- static void Initialize(v8::Handle<v8::Object> target,
- v8::Handle<v8::Value> unused,
- v8::Handle<v8::Context> context);
+ static void Initialize(v8::Local<v8::Object> target,
+ v8::Local<v8::Value> unused,
+ v8::Local<v8::Context> context);
static void GetFD(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>&);
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
int (*F)(const typename T::HandleType*, sockaddr*, int*)>
friend void GetSockOrPeerName(const v8::FunctionCallbackInfo<v8::Value>&);
- UDPWrap(Environment* env, v8::Handle<v8::Object> object, AsyncWrap* parent);
+ UDPWrap(Environment* env, v8::Local<v8::Object> object, AsyncWrap* parent);
static void DoBind(const v8::FunctionCallbackInfo<v8::Value>& args,
int family);
namespace node {
-Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle<v8::Value> value)
+Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> value)
: length_(0), str_(str_st_) {
if (value.IsEmpty())
return;
class Utf8Value {
public:
- explicit Utf8Value(v8::Isolate* isolate, v8::Handle<v8::Value> value);
+ explicit Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> value);
~Utf8Value() {
if (str_ != str_st_)
using v8::Context;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
-using v8::Handle;
+using v8::Local;
using v8::Integer;
using v8::Object;
using v8::String;
}
-void Initialize(Handle<Object> target,
- Handle<Value> unused,
- Handle<Context> context) {
+void Initialize(Local<Object> target,
+ Local<Value> unused,
+ Local<Context> context) {
Environment* env = Environment::GetCurrent(context);
target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "errname"),
env->NewFunctionTemplate(ErrName)->GetFunction());
v8::Isolate* isolate = req->isolate;
v8::HandleScope scope(isolate);
- v8::Handle<v8::Value> argv[2] = {
+ v8::Local<v8::Value> argv[2] = {
v8::Null(isolate),
v8::Integer::New(isolate, req->output)
};
(uv_after_work_cb)AfterAsync);
}
-void init(v8::Handle<v8::Object> exports, v8::Handle<v8::Object> module) {
+void init(v8::Local<v8::Object> exports, v8::Local<v8::Object> module) {
NODE_SET_METHOD(module, "exports", Method);
}
#include <v8.h>
using node::AtExit;
-using v8::Handle;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
assert(at_exit_cb2_called == 2);
}
-void init(Handle<Object> target) {
+void init(Local<Object> target) {
AtExit(at_exit_cb1, target->CreationContext()->GetIsolate());
AtExit(at_exit_cb2, cookie);
AtExit(at_exit_cb2, cookie);
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
}
-void init(v8::Handle<v8::Object> exports, v8::Handle<v8::Object> module) {
+void init(v8::Local<v8::Object> exports, v8::Local<v8::Object> module) {
NODE_SET_METHOD(module, "exports", Method);
}
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
}
-void init(v8::Handle<v8::Object> target) {
+void init(v8::Local<v8::Object> target) {
NODE_SET_METHOD(target, "hello", Method);
}
using v8::Function;
using v8::FunctionCallbackInfo;
-using v8::Handle;
+using v8::Local;
using v8::HandleScope;
using v8::Isolate;
using v8::Object;
NULL);
}
-void init(Handle<Object> target) {
+void init(Local<Object> target) {
NODE_SET_METHOD(target, "method", Method);
}
using v8::Function;
using v8::FunctionTemplate;
using v8::FunctionCallbackInfo;
-using v8::Handle;
using v8::HandleScope;
using v8::Integer;
using v8::Isolate;
Persistent<ObjectTemplate> proxyClass;
-bool IsDead(Handle<Object> proxy) {
+bool IsDead(Local<Object> proxy) {
assert(proxy->InternalFieldCount() == 1);
proxy_container *cont = reinterpret_cast<proxy_container*>(
proxy->GetAlignedPointerFromInternalField(0));
}
-Handle<Object> Unwrap(Handle<Object> proxy) {
+Local<Object> Unwrap(Local<Object> proxy) {
assert(!IsDead(proxy));
proxy_container *cont = reinterpret_cast<proxy_container*>(
proxy->GetAlignedPointerFromInternalField(0));
return Local<Object>::New(isolate, cont->target);
}
-Handle<Array> GetCallbacks(Handle<Object> proxy) {
+Local<Array> GetCallbacks(Local<Object> proxy) {
proxy_container *cont = reinterpret_cast<proxy_container*>(
proxy->GetAlignedPointerFromInternalField(0));
assert(cont != NULL);
#define UNWRAP \
HandleScope scope(info.GetIsolate()); \
- Handle<Object> obj; \
+ Local<Object> obj; \
const bool dead = IsDead(info.This()); \
if (!dead) obj = Unwrap(info.This()); \
}
-void AddCallback(Isolate* isolate, Handle<Object> proxy, Handle<Function> callback) {
- Handle<Array> callbacks = GetCallbacks(proxy);
+void AddCallback(Isolate* isolate, Local<Object> proxy, Local<Function> callback) {
+ Local<Array> callbacks = GetCallbacks(proxy);
callbacks->Set(Integer::New(isolate, callbacks->Length()), callback);
}
// invoke any listening callbacks
Local<Array> callbacks = Local<Array>::New(isolate, cont->callbacks);
uint32_t len = callbacks->Length();
- Handle<Value> argv[1];
+ Local<Value> argv[1];
argv[0] = target;
for (uint32_t i=0; i<len; i++) {
- Handle<Function> cb = Handle<Function>::Cast(
+ Local<Function> cb = Local<Function>::Cast(
callbacks->Get(Integer::New(isolate, i)));
TryCatch try_catch;
cont->target.SetWeak(cont, TargetCallback);
if (args.Length() >= 2) {
- AddCallback(args.GetIsolate(), proxy, Handle<Function>::Cast(args[1]));
+ AddCallback(args.GetIsolate(), proxy, Local<Function>::Cast(args[1]));
}
args.GetReturnValue().Set(proxy);
* TODO: Make this better.
*/
-bool isWeakRef (Handle<Value> val) {
+bool isWeakRef (Local<Value> val) {
return val->IsObject() && val->ToObject()->InternalFieldCount() == 1;
}
Local<Object> proxy = args[0]->ToObject();
if (IsDead(proxy)) return;
- Handle<Object> obj = Unwrap(proxy);
+ Local<Object> obj = Unwrap(proxy);
args.GetReturnValue().Set(obj);
}
}
Local<Object> proxy = args[0]->ToObject();
- AddCallback(args.GetIsolate(), proxy, Handle<Function>::Cast(args[1]));
+ AddCallback(args.GetIsolate(), proxy, Local<Function>::Cast(args[1]));
}
void Callbacks(const FunctionCallbackInfo<Value>& args) {
}
-void Initialize(Handle<Object> target) {
+void Initialize(Local<Object> target) {
HandleScope scope(target->CreationContext()->GetIsolate());
Local<ObjectTemplate> tmpl = ObjectTemplate::New();