Skip to content

Commit

Permalink
Fix compiling on io.js 1 & 2 (#706)
Browse files Browse the repository at this point in the history
* Fix compiling on io.js 1 & 2

* Break up a long line

* Split a long comment
  • Loading branch information
abalabahaha authored and kkoopa committed Oct 26, 2017
1 parent 1a70a86 commit 82705a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nan_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ class JSON {
return scope.Escape(parse(json_string));
#else
Nan::MaybeLocal<v8::Value> result;
#if NODE_MODULE_VERSION == NODE_0_12_MODULE_VERSION
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION && \
NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION
result = v8::JSON::Parse(json_string);
#else
#if NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION
Expand All @@ -87,7 +88,8 @@ class JSON {
v8::Isolate* context_or_isolate = v8::Isolate::GetCurrent();
#endif // NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION
result = v8::JSON::Parse(context_or_isolate, json_string);
#endif // NODE_MODULE_VERSION == NODE_0_12_MODULE_VERSION
#endif // NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION &&
// NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION
if (result.IsEmpty()) return v8::Local<v8::Value>();
return scope.Escape(result.ToLocalChecked());
#endif // NAN_JSON_H_NEED_PARSE
Expand Down

0 comments on commit 82705a6

Please sign in to comment.