Skip to content

Commit

Permalink
Remove Nan prefix from all names
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa committed Jul 4, 2015
1 parent 621bc30 commit 72d1f67
Show file tree
Hide file tree
Showing 49 changed files with 1,658 additions and 1,658 deletions.
818 changes: 409 additions & 409 deletions nan.h

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions nan_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,56 @@
#ifndef NAN_CALLBACKS_H_
#define NAN_CALLBACKS_H_

template<typename T> class NanFunctionCallbackInfo;
template<typename T> class NanPropertyCallbackInfo;
template<typename T> class NanGlobal;

typedef void(*NanFunctionCallback)(const NanFunctionCallbackInfo<v8::Value>&);
typedef void(*NanGetterCallback)
(v8::Local<v8::String>, const NanPropertyCallbackInfo<v8::Value>&);
typedef void(*NanSetterCallback)(
template<typename T> class FunctionCallbackInfo;
template<typename T> class PropertyCallbackInfo;
template<typename T> class Global;

typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
typedef void(*GetterCallback)
(v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
typedef void(*SetterCallback)(
v8::Local<v8::String>,
v8::Local<v8::Value>,
const NanPropertyCallbackInfo<void>&);
typedef void(*NanPropertyGetterCallback)(
const PropertyCallbackInfo<void>&);
typedef void(*PropertyGetterCallback)(
v8::Local<v8::String>,
const NanPropertyCallbackInfo<v8::Value>&);
typedef void(*NanPropertySetterCallback)(
const PropertyCallbackInfo<v8::Value>&);
typedef void(*PropertySetterCallback)(
v8::Local<v8::String>,
v8::Local<v8::Value>,
const NanPropertyCallbackInfo<v8::Value>&);
typedef void(*NanPropertyEnumeratorCallback)
(const NanPropertyCallbackInfo<v8::Array>&);
typedef void(*NanPropertyDeleterCallback)(
const PropertyCallbackInfo<v8::Value>&);
typedef void(*PropertyEnumeratorCallback)
(const PropertyCallbackInfo<v8::Array>&);
typedef void(*PropertyDeleterCallback)(
v8::Local<v8::String>,
const NanPropertyCallbackInfo<v8::Boolean>&);
typedef void(*NanPropertyQueryCallback)(
const PropertyCallbackInfo<v8::Boolean>&);
typedef void(*PropertyQueryCallback)(
v8::Local<v8::String>,
const NanPropertyCallbackInfo<v8::Integer>&);
typedef void(*NanIndexGetterCallback)(
const PropertyCallbackInfo<v8::Integer>&);
typedef void(*IndexGetterCallback)(
uint32_t,
const NanPropertyCallbackInfo<v8::Value>&);
typedef void(*NanIndexSetterCallback)(
const PropertyCallbackInfo<v8::Value>&);
typedef void(*IndexSetterCallback)(
uint32_t,
v8::Local<v8::Value>,
const NanPropertyCallbackInfo<v8::Value>&);
typedef void(*NanIndexEnumeratorCallback)
(const NanPropertyCallbackInfo<v8::Array>&);
typedef void(*NanIndexDeleterCallback)(
const PropertyCallbackInfo<v8::Value>&);
typedef void(*IndexEnumeratorCallback)
(const PropertyCallbackInfo<v8::Array>&);
typedef void(*IndexDeleterCallback)(
uint32_t,
const NanPropertyCallbackInfo<v8::Boolean>&);
typedef void(*NanIndexQueryCallback)(
const PropertyCallbackInfo<v8::Boolean>&);
typedef void(*IndexQueryCallback)(
uint32_t,
const NanPropertyCallbackInfo<v8::Integer>&);
const PropertyCallbackInfo<v8::Integer>&);

namespace imp {
typedef v8::Handle<v8::AccessorSignature> Sig;

#define X(NAME) \
struct NAME ## Wrapper { \
explicit NAME ## Wrapper(Nan ## NAME ## Callback callback_) : \
explicit NAME ## Wrapper(NAME ## Callback callback_) : \
callback(callback_) {} \
Nan ## NAME ## Callback callback; \
NAME ## Callback callback; \
};

X(Function)
Expand Down
66 changes: 33 additions & 33 deletions nan_callbacks_12_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#define NAN_CALLBACKS_12_INL_H_

template<typename T>
class NanReturnValue {
class ReturnValue {
v8::ReturnValue<T> value_;

public:
template <class S>
explicit inline NanReturnValue(const v8::ReturnValue<S> &value) :
explicit inline ReturnValue(const v8::ReturnValue<S> &value) :
value_(value) {}
template <class S>
explicit inline NanReturnValue(const NanReturnValue<S>& that)
explicit inline ReturnValue(const ReturnValue<S>& that)
: value_(that.value_) {
TYPE_CHECK(T, S);
}
Expand All @@ -29,7 +29,7 @@ class NanReturnValue {
value_.Set(handle);
}

template <typename S> inline void Set(const NanGlobal<S> &handle) {
template <typename S> inline void Set(const Global<S> &handle) {
TYPE_CHECK(T, S);
#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
(V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && \
Expand All @@ -38,7 +38,7 @@ class NanReturnValue {
value_.Set(handle);
#else
value_.Set(*reinterpret_cast<const v8::Persistent<S>*>(&handle));
const_cast<NanGlobal<S> &>(handle).Reset();
const_cast<Global<S> &>(handle).Reset();
#endif
}

Expand Down Expand Up @@ -90,19 +90,19 @@ class NanReturnValue {
};

template<typename T>
class NanFunctionCallbackInfo {
class FunctionCallbackInfo {
const v8::FunctionCallbackInfo<T> &info_;
const v8::Local<v8::Value> data_;

public:
explicit inline NanFunctionCallbackInfo(
explicit inline FunctionCallbackInfo(
const v8::FunctionCallbackInfo<T> &info
, v8::Local<v8::Value> data) :
info_(info)
, data_(data) {}

inline NanReturnValue<T> GetReturnValue() const {
return NanReturnValue<T>(info_.GetReturnValue());
inline ReturnValue<T> GetReturnValue() const {
return ReturnValue<T>(info_.GetReturnValue());
}

inline v8::Local<v8::Function> Callee() const { return info_.Callee(); }
Expand All @@ -127,12 +127,12 @@ class NanFunctionCallbackInfo {
};

template<typename T>
class NanPropertyCallbackInfo {
class PropertyCallbackInfo {
const v8::PropertyCallbackInfo<T> &info_;
const v8::Local<v8::Value> data_;

public:
explicit inline NanPropertyCallbackInfo(
explicit inline PropertyCallbackInfo(
const v8::PropertyCallbackInfo<T> &info
, const v8::Local<v8::Value> &data) :
info_(info)
Expand All @@ -142,8 +142,8 @@ class NanPropertyCallbackInfo {
inline v8::Local<v8::Value> Data() const { return data_; }
inline v8::Local<v8::Object> This() const { return info_.This(); }
inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
inline NanReturnValue<T> GetReturnValue() const {
return NanReturnValue<T>(info_.GetReturnValue());
inline ReturnValue<T> GetReturnValue() const {
return ReturnValue<T>(info_.GetReturnValue());
}

protected:
Expand All @@ -162,7 +162,7 @@ void FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
FunctionWrapper *wrapper = static_cast<FunctionWrapper*>(
obj->GetAlignedPointerFromInternalField(kFunctionIndex));
NanFunctionCallbackInfo<v8::Value>
FunctionCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
wrapper->callback(cbinfo);
}
Expand All @@ -175,7 +175,7 @@ void GetterCallbackWrapper(
v8::Local<v8::Name> property
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
GetterWrapper *wrapper = static_cast<GetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kGetterIndex));
Expand All @@ -191,7 +191,7 @@ void SetterCallbackWrapper(
, v8::Local<v8::Value> value
, const v8::PropertyCallbackInfo<void> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<void>
PropertyCallbackInfo<void>
cbinfo(info, obj->GetInternalField(kDataIndex));
SetterWrapper *wrapper = static_cast<SetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kSetterIndex));
Expand All @@ -208,7 +208,7 @@ void GetterCallbackWrapper(
v8::Local<v8::String> property
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
GetterWrapper *wrapper = static_cast<GetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kGetterIndex));
Expand All @@ -224,7 +224,7 @@ void SetterCallbackWrapper(
, v8::Local<v8::Value> value
, const v8::PropertyCallbackInfo<void> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<void>
PropertyCallbackInfo<void>
cbinfo(info, obj->GetInternalField(kDataIndex));
SetterWrapper *wrapper = static_cast<SetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kSetterIndex));
Expand All @@ -243,7 +243,7 @@ void PropertyGetterCallbackWrapper(
v8::Local<v8::Name> property
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyGetterWrapper *wrapper = static_cast<PropertyGetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyGetterIndex));
Expand All @@ -259,7 +259,7 @@ void PropertySetterCallbackWrapper(
, v8::Local<v8::Value> value
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertySetterWrapper *wrapper = static_cast<PropertySetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertySetterIndex));
Expand All @@ -275,7 +275,7 @@ static
void PropertyEnumeratorCallbackWrapper(
const v8::PropertyCallbackInfo<v8::Array> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Array>
PropertyCallbackInfo<v8::Array>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyEnumeratorWrapper *wrapper = static_cast<PropertyEnumeratorWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyEnumeratorIndex));
Expand All @@ -290,7 +290,7 @@ void PropertyDeleterCallbackWrapper(
v8::Local<v8::Name> property
, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Boolean>
PropertyCallbackInfo<v8::Boolean>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyDeleterWrapper *wrapper = static_cast<PropertyDeleterWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyDeleterIndex));
Expand All @@ -305,7 +305,7 @@ void PropertyQueryCallbackWrapper(
v8::Local<v8::Name> property
, const v8::PropertyCallbackInfo<v8::Integer> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Integer>
PropertyCallbackInfo<v8::Integer>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyQueryWrapper *wrapper = static_cast<PropertyQueryWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyQueryIndex));
Expand All @@ -320,7 +320,7 @@ void PropertyGetterCallbackWrapper(
v8::Local<v8::String> property
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyGetterWrapper *wrapper = static_cast<PropertyGetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyGetterIndex));
Expand All @@ -336,7 +336,7 @@ void PropertySetterCallbackWrapper(
, v8::Local<v8::Value> value
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertySetterWrapper *wrapper = static_cast<PropertySetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertySetterIndex));
Expand All @@ -352,7 +352,7 @@ static
void PropertyEnumeratorCallbackWrapper(
const v8::PropertyCallbackInfo<v8::Array> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Array>
PropertyCallbackInfo<v8::Array>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyEnumeratorWrapper *wrapper = static_cast<PropertyEnumeratorWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyEnumeratorIndex));
Expand All @@ -367,7 +367,7 @@ void PropertyDeleterCallbackWrapper(
v8::Local<v8::String> property
, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Boolean>
PropertyCallbackInfo<v8::Boolean>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyDeleterWrapper *wrapper = static_cast<PropertyDeleterWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyDeleterIndex));
Expand All @@ -382,7 +382,7 @@ void PropertyQueryCallbackWrapper(
v8::Local<v8::String> property
, const v8::PropertyCallbackInfo<v8::Integer> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Integer>
PropertyCallbackInfo<v8::Integer>
cbinfo(info, obj->GetInternalField(kDataIndex));
PropertyQueryWrapper *wrapper = static_cast<PropertyQueryWrapper*>(
obj->GetAlignedPointerFromInternalField(kPropertyQueryIndex));
Expand All @@ -397,7 +397,7 @@ static
void IndexGetterCallbackWrapper(
uint32_t index, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
IndexGetterWrapper *wrapper = static_cast<IndexGetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kIndexPropertyGetterIndex));
Expand All @@ -413,7 +413,7 @@ void IndexSetterCallbackWrapper(
, v8::Local<v8::Value> value
, const v8::PropertyCallbackInfo<v8::Value> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Value>
PropertyCallbackInfo<v8::Value>
cbinfo(info, obj->GetInternalField(kDataIndex));
IndexSetterWrapper *wrapper = static_cast<IndexSetterWrapper*>(
obj->GetAlignedPointerFromInternalField(kIndexPropertySetterIndex));
Expand All @@ -429,7 +429,7 @@ static
void IndexEnumeratorCallbackWrapper(
const v8::PropertyCallbackInfo<v8::Array> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Array>
PropertyCallbackInfo<v8::Array>
cbinfo(info, obj->GetInternalField(kDataIndex));
IndexEnumeratorWrapper *wrapper = static_cast<IndexEnumeratorWrapper*>(
obj->GetAlignedPointerFromInternalField(kIndexPropertyEnumeratorIndex));
Expand All @@ -443,7 +443,7 @@ static
void IndexDeleterCallbackWrapper(
uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Boolean>
PropertyCallbackInfo<v8::Boolean>
cbinfo(info, obj->GetInternalField(kDataIndex));
IndexDeleterWrapper *wrapper = static_cast<IndexDeleterWrapper*>(
obj->GetAlignedPointerFromInternalField(kIndexPropertyDeleterIndex));
Expand All @@ -457,7 +457,7 @@ static
void IndexQueryCallbackWrapper(
uint32_t index, const v8::PropertyCallbackInfo<v8::Integer> &info) {
v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
NanPropertyCallbackInfo<v8::Integer>
PropertyCallbackInfo<v8::Integer>
cbinfo(info, obj->GetInternalField(kDataIndex));
IndexQueryWrapper *wrapper = static_cast<IndexQueryWrapper*>(
obj->GetAlignedPointerFromInternalField(kIndexPropertyQueryIndex));
Expand Down

0 comments on commit 72d1f67

Please sign in to comment.