All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.nan_converters_pre_43_inl.h Maven / Gradle / Ivy

Go to download

Native Abstractions for Node.js: C++ header for Node 0.8 -> 18 compatibility

There is a newer version: 2.19.0
Show newest version
/*********************************************************************
 * NAN - Native Abstractions for Node.js
 *
 * Copyright (c) 2018 NAN contributors
 *
 * MIT License 
 ********************************************************************/

#ifndef NAN_CONVERTERS_PRE_43_INL_H_
#define NAN_CONVERTERS_PRE_43_INL_H_

#define X(TYPE)                                                                \
imp::ToFactory::return_t                                             \
imp::ToFactory::convert(v8::Local val) {                  \
  return val->To ## TYPE();                                                    \
}

X(Boolean)
X(Number)
X(String)
X(Object)
X(Integer)
X(Uint32)
X(Int32)

#undef X

#define X(TYPE, NAME)                                                          \
imp::ToFactory::return_t                                                 \
imp::ToFactory::convert(v8::Local val) {                      \
  return Just(val->NAME ## Value());                                           \
}

X(bool, Boolean)
X(double, Number)
X(int64_t, Integer)
X(uint32_t, Uint32)
X(int32_t, Int32)

#undef X

#endif  // NAN_CONVERTERS_PRE_43_INL_H_




© 2015 - 2024 Weber Informatics LLC | Privacy Policy