The nan update branch seems a bit messy, but from what I can gather some tool was used to replace all occurances of NanReturnValue() with info.GetReturnValue().Set(). The problem with this is that the NanReturnValue() macro in nan 1 actually returned from the c function, while the replacement doesn't.
In a lot of cases this library did something like this:
if (condition) {
NanReturnValue(something);
}
NanReturnValue(something_else);
Which was replaced by this:
if (condition) {
info.GetReturnValue().Set(something);
}
info.GetReturnValue().Set(something_else);
So the JS return value is always set to something_else before returning from the c function.
The solution in this branch is not ideal, but seems to work.
The nan update branch seems a bit messy, but from what I can gather some tool was used to replace all occurances of
NanReturnValue()
withinfo.GetReturnValue().Set()
. The problem with this is that theNanReturnValue()
macro in nan 1 actually returned from the c function, while the replacement doesn't.In a lot of cases this library did something like this:
Which was replaced by this:
So the JS return value is always set to
something_else
before returning from the c function.The solution in this branch is not ideal, but seems to work.