Skip to content

Commit

Permalink
fix: check V8 version directly instead of inferring from NMV (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored and kkoopa committed Mar 14, 2019
1 parent 24c6357 commit 12f9df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions nan_converters_43_inl.h
Expand Up @@ -25,7 +25,8 @@ X(Object)
X(Integer)
X(Uint32)
X(Int32)
#if NODE_MODULE_VERSION <= NODE_11_0_MODULE_VERSION
// V8 <= 7.0
#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0)
X(Boolean)
#else
imp::ToFactory<v8::Boolean>::return_t \
Expand All @@ -50,7 +51,8 @@ X(double, Number)
X(int64_t, Integer)
X(uint32_t, Uint32)
X(int32_t, Int32)
#if NODE_MODULE_VERSION <= NODE_11_0_MODULE_VERSION
// V8 <= 7.0
#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0)
X(bool, Boolean)
#else
imp::ToFactory<bool>::return_t \
Expand Down
3 changes: 2 additions & 1 deletion nan_implementation_12_inl.h
Expand Up @@ -345,7 +345,8 @@ Factory<v8::String>::New(ExternalOneByteStringResource * value) {
// TODO(bnoordhuis) Use isolate-based version in Node.js v12.
Factory<v8::StringObject>::return_t
Factory<v8::StringObject>::New(v8::Local<v8::String> value) {
#if NODE_MODULE_VERSION > NODE_11_0_MODULE_VERSION
// V8 > 7.0
#if V8_MAJOR_VERSION > 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION > 0)
return v8::StringObject::New(v8::Isolate::GetCurrent(), value).As<v8::StringObject>();
#else
#ifdef _MSC_VER
Expand Down

0 comments on commit 12f9df9

Please sign in to comment.