diff --git a/deps/swisseph/swehel.c b/deps/swisseph/swehel.c index 59039f8..c69ba89 100644 --- a/deps/swisseph/swehel.c +++ b/deps/swisseph/swehel.c @@ -228,7 +228,7 @@ static double OpticFactor(double Bback, double kX, double *dobs, double JDNDaysU double OpticDia = dobs[4]; double OpticTrans = dobs[5]; AS_BOOL is_scotopic = FALSE; - JDNDaysUT = JDNDaysUT; /* currently not used, statement prevents compiler warning */ + //JDNDaysUT = JDNDaysUT; /* currently not used, statement prevents compiler warning */ SNi = SN; if (SNi <= 0.00000001) SNi = 0.00000001; /* 23 jaar as standard from Garstang*/ @@ -553,7 +553,7 @@ static double SunRA(double JDNDaysUT, int32 helflag, char *serr) double dut; static TLS double tjdlast; static TLS double ralast; - helflag = helflag; /* statement prevents compiler warning */ + //helflag = helflag; /* statement prevents compiler warning */ *serr = '\0'; if (JDNDaysUT == tjdlast) return ralast; @@ -1265,7 +1265,7 @@ static double Bday(double AltO, double AziO, double AltS, double AziS, double su static double Bcity(double Value, double Press) { double Bcity = Value; - Press = Press; /* unused; statement prevents compiler warning */ + //Press = Press; /* unused; statement prevents compiler warning */ Bcity = mymax(Bcity, 0); return Bcity; } diff --git a/deps/swisseph/sweph.c b/deps/swisseph/sweph.c index 159ef44..e2da85e 100644 --- a/deps/swisseph/sweph.c +++ b/deps/swisseph/sweph.c @@ -6524,7 +6524,7 @@ static int32 search_star_in_list(char *sstar, struct fixed_star *stardata, char } else if (!is_bayer && (sp = strchr(sstar, '%')) != NULL) { stardatabegp = &(swed.fixed_stars[swed.n_fixstars_real]); ndata = swed.n_fixstars_named; - if (sp - sstar != strlen(sstar) - 1) { + if (sp - sstar != (unsigned)(strlen(sstar) - 1)) { if (serr != NULL) sprintf(serr, "error, swe_fixstar(): invalid search string %s", sstar); return ERR; diff --git a/deps/swisseph/swephlib.c b/deps/swisseph/swephlib.c index 8005a5e..2f254c4 100644 --- a/deps/swisseph/swephlib.c +++ b/deps/swisseph/swephlib.c @@ -789,7 +789,7 @@ static void owen_pre_matrix(double tjd, double *rp, int iflag) oma += (k[i] * owen_oma_coef[icof][i]); chia += (k[i] * owen_chia_coef[icof][i]); } - if (iflag & (SEFLG_JPLHOR || SEFLG_JPLHOR_APPROX)) { + if (iflag & (SEFLG_JPLHOR | SEFLG_JPLHOR_APPROX)) { /* * In comparison with JPL Horizons we have an almost constant offset * almost constant offset in ecl. longitude of about -0.000019 deg. diff --git a/package.json b/package.json index 8deee3b..87c752c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "mivion", "name": "swisseph", "description": "Swiss Ephemeris binding for node.js", - "version": "0.5.8", + "version": "0.5.9", "homepage": "http://github.com/mivion/swisseph", "repository": { "url": "http://github.com/mivion/swisseph.git" @@ -15,9 +15,9 @@ "astronomy" ], "dependencies": { + "merge": "^1.2.x", "nan": "^2.1.x", - "node-gyp": "3.0.x", - "merge": "^1.2.x" + "node-gyp": "^3.8.0" }, "devDependencies": {}, "optionalDependencies": {}, diff --git a/src/date.cc b/src/date.cc index 3532e6d..9f537bc 100644 --- a/src/date.cc +++ b/src/date.cc @@ -22,7 +22,7 @@ NAN_METHOD(node_swe_date_conversion) { !info [1]->IsNumber () || !info [2]->IsNumber () || !info [3]->IsNumber () || - (!info [4]->IsString () && info [4]->ToString ()->Length () > 0) + (!info [4]->IsString () && info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Length () > 0) ) { Nan::ThrowTypeError ("Wrong type of arguments"); }; @@ -33,11 +33,11 @@ NAN_METHOD(node_swe_date_conversion) { Local result = Nan::New (); rflag = ::swe_date_conversion ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), - info [3]->NumberValue (), - (* String::Utf8Value (info [4]->ToString ())) [0], + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (* String::Utf8Value (Isolate::GetCurrent(), info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0], &tjd ); @@ -74,11 +74,11 @@ NAN_METHOD(node_swe_julday) { }; Local result = Nan::New (::swe_julday ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), - info [3]->NumberValue (), - (int)info [4]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked() )); HandleCallback (info, result); @@ -115,8 +115,8 @@ NAN_METHOD(node_swe_revjul) { Local result = Nan::New (); ::swe_revjul ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &year, &month, &day, &hour ); @@ -164,13 +164,13 @@ NAN_METHOD(node_swe_utc_to_jd) { Local result = Nan::New (); rflag = ::swe_utc_to_jd ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), - (int)info [3]->NumberValue (), - (int)info [4]->NumberValue (), - info [5]->NumberValue (), - (int)info [6]->NumberValue (), + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(), tjd, serr ); @@ -217,8 +217,8 @@ NAN_METHOD(node_swe_jdet_to_utc) { Local result = Nan::New (); ::swe_jdet_to_utc ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &year, &month, &day, &hour, &minute, &second ); @@ -265,8 +265,8 @@ NAN_METHOD(node_swe_jdut1_to_utc) { Local result = Nan::New (); ::swe_jdut1_to_utc ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &year, &month, &day, &hour, &minute, &second ); @@ -318,13 +318,13 @@ NAN_METHOD(node_swe_utc_time_zone) { Local result = Nan::New (); ::swe_utc_time_zone ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), - (int)info [3]->NumberValue (), - (int)info [4]->NumberValue (), - info [5]->NumberValue (), - info [6]->NumberValue (), + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &year, &month, &day, &hour, &minute, &second ); diff --git a/src/eclipse.cc b/src/eclipse.cc index 433df35..ba94179 100644 --- a/src/eclipse.cc +++ b/src/eclipse.cc @@ -39,21 +39,21 @@ NAN_METHOD(node_swe_gauquelin_sector) { char serr [AS_MAXCH]; long rflag; - ::strcpy (star, * String::Utf8Value (info [2]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); - geopos [0] = info [5]->NumberValue (); - geopos [1] = info [6]->NumberValue (); - geopos [2] = info [7]->NumberValue (); + geopos [0] = info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [7]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_gauquelin_sector ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), star, - (int)info [3]->NumberValue (), - (int)info [4]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, - info [8]->NumberValue (), - info [9]->NumberValue (), + info [8]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [9]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &dgsect, serr ); @@ -111,8 +111,8 @@ NAN_METHOD(node_swe_sol_eclipse_where) { long rflag; rflag = ::swe_sol_eclipse_where ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, attr, serr ); @@ -181,13 +181,13 @@ NAN_METHOD(node_swe_lun_occult_where) { char serr [AS_MAXCH]; long rflag; - ::strcpy (star, * String::Utf8Value (info [2]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_lun_occult_where ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), star, - (int)info [3]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, attr, serr ); @@ -254,13 +254,13 @@ NAN_METHOD(node_swe_sol_eclipse_how) { char serr [AS_MAXCH]; long rflag; - geopos [0] = info [2]->NumberValue (); - geopos [1] = info [3]->NumberValue (); - geopos [2] = info [4]->NumberValue (); + geopos [0] = info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_sol_eclipse_how ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, attr, serr ); @@ -335,15 +335,15 @@ NAN_METHOD(node_swe_sol_eclipse_when_loc) { char serr [AS_MAXCH]; long rflag; - geopos [0] = info [2]->NumberValue (); - geopos [1] = info [3]->NumberValue (); - geopos [2] = info [4]->NumberValue (); + geopos [0] = info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_sol_eclipse_when_loc ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, tret, attr, - (int)info [5]->NumberValue (), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), serr ); @@ -427,19 +427,19 @@ NAN_METHOD(node_swe_lun_occult_when_loc) { char serr [AS_MAXCH]; long rflag; - ::strcpy (star, * String::Utf8Value (info [2]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); - geopos [0] = info [4]->NumberValue (); - geopos [1] = info [5]->NumberValue (); - geopos [2] = info [6]->NumberValue (); + geopos [0] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_lun_occult_when_loc ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), star, - (int)info [3]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, tret, attr, - (int)info [7]->NumberValue (), + (int)info [7]->NumberValue (Nan::GetCurrentContext()).ToChecked(), serr ); @@ -509,11 +509,11 @@ NAN_METHOD(node_swe_sol_eclipse_when_glob) { long rflag; rflag = ::swe_sol_eclipse_when_glob ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), tret, - (int)info [3]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), serr ); @@ -577,16 +577,16 @@ NAN_METHOD(node_swe_lun_occult_when_glob) { char serr [AS_MAXCH]; long rflag; - ::strcpy (star, * String::Utf8Value (info [2]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_lun_occult_when_glob ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), star, - (int)info [3]->NumberValue (), - (int)info [4]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), tret, - (int)info [5]->NumberValue (), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), serr ); @@ -650,13 +650,13 @@ NAN_METHOD(node_swe_lun_eclipse_how) { char serr [AS_MAXCH]; long rflag; - geopos [0] = info [2]->NumberValue (); - geopos [1] = info [3]->NumberValue (); - geopos [2] = info [4]->NumberValue (); + geopos [0] = info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_lun_eclipse_how ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, attr, serr ); @@ -717,11 +717,11 @@ NAN_METHOD(node_swe_lun_eclipse_when) { long rflag; rflag = ::swe_lun_eclipse_when ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), tret, - (int)info [3]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), serr ); @@ -793,15 +793,15 @@ NAN_METHOD(node_swe_lun_eclipse_when_loc) { char serr [AS_MAXCH]; long rflag; - geopos [0] = info [2]->NumberValue (); - geopos [1] = info [3]->NumberValue (); - geopos [2] = info [4]->NumberValue (); + geopos [0] = info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_lun_eclipse_when_loc ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, tret, attr, - (int)info [5]->NumberValue (), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), serr ); @@ -866,9 +866,9 @@ NAN_METHOD(node_swe_pheno) { long rflag; rflag = ::swe_pheno ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), attr, serr ); @@ -921,9 +921,9 @@ NAN_METHOD(node_swe_pheno_ut) { long rflag; rflag = ::swe_pheno_ut ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), attr, serr ); @@ -970,10 +970,10 @@ NAN_METHOD(node_swe_refrac) { double refraction; refraction = ::swe_refrac ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue (), - (int)info [3]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -1016,12 +1016,12 @@ NAN_METHOD(node_swe_refrac_extended) { double dret [4]; refraction = ::swe_refrac_extended ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue (), - info [3]->NumberValue (), - info [4]->NumberValue (), - (int)info [5]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), dret ); @@ -1056,7 +1056,7 @@ NAN_METHOD(node_swe_set_lapse_rate) { }; ::swe_set_lapse_rate ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -1100,20 +1100,20 @@ NAN_METHOD(node_swe_azalt) { double xin [3] = {0}; double xaz [3] = {0}; - geopos [0] = info [2]->NumberValue (); - geopos [1] = info [3]->NumberValue (); - geopos [2] = info [4]->NumberValue (); + geopos [0] = info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); - xin [0] = info [7]->NumberValue (); - xin [1] = info [8]->NumberValue (); - xin [2] = info [9]->NumberValue (); + xin [0] = info [7]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xin [1] = info [8]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xin [2] = info [9]->NumberValue (Nan::GetCurrentContext()).ToChecked(); ::swe_azalt ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, - info [5]->NumberValue (), - info [6]->NumberValue (), + info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(), xin, xaz ); @@ -1158,16 +1158,16 @@ NAN_METHOD(node_swe_azalt_rev) { double xin [3] = {0}; double xout [3] = {0}; - geopos [0] = info [2]->NumberValue (); - geopos [1] = info [3]->NumberValue (); - geopos [2] = info [4]->NumberValue (); + geopos [0] = info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(); - xin [0] = info [5]->NumberValue (); - xin [1] = info [6]->NumberValue (); + xin [0] = info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xin [1] = info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(); ::swe_azalt_rev ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, xin, xout ); @@ -1217,21 +1217,21 @@ NAN_METHOD(node_swe_rise_trans) { char serr [AS_MAXCH]; long rflag; - ::strcpy (star, * String::Utf8Value (info [2]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); - geopos [0] = info [5]->NumberValue (); - geopos [1] = info [6]->NumberValue (); - geopos [2] = info [7]->NumberValue (); + geopos [0] = info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [7]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_rise_trans ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), star, - (int)info [3]->NumberValue (), - (int)info [4]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, - info [8]->NumberValue (), - info [9]->NumberValue (), + info [8]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [9]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &tret, serr ); @@ -1290,22 +1290,22 @@ NAN_METHOD(node_swe_rise_trans_true_hor) { char serr [AS_MAXCH]; long rflag; - ::strcpy (star, * String::Utf8Value (info [2]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); - geopos [0] = info [5]->NumberValue (); - geopos [1] = info [6]->NumberValue (); - geopos [2] = info [7]->NumberValue (); + geopos [0] = info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [1] = info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(); + geopos [2] = info [7]->NumberValue (Nan::GetCurrentContext()).ToChecked(); rflag = ::swe_rise_trans_true_hor ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), star, - (int)info [3]->NumberValue (), - (int)info [4]->NumberValue (), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), geopos, - info [8]->NumberValue (), - info [9]->NumberValue (), - info [10]->NumberValue (), + info [8]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [9]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [10]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &tret, serr ); @@ -1389,10 +1389,10 @@ NAN_METHOD(node_swe_nod_aps) { long rflag; rflag = ::swe_nod_aps ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), - (int)info [3]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), xnasc, xndsc, xperi, xaphe, serr ); @@ -1401,7 +1401,7 @@ NAN_METHOD(node_swe_nod_aps) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { Local ascending = Nan::New (); ascending->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (xnasc [0])); ascending->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (xnasc [1])); @@ -1438,7 +1438,7 @@ NAN_METHOD(node_swe_nod_aps) { aphelion->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (xaphe [5])); result->Set (Nan::New ("aphelion").ToLocalChecked(), aphelion); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { Local ascending = Nan::New (); ascending->Set (Nan::New ("x").ToLocalChecked(), Nan::New (xnasc [0])); ascending->Set (Nan::New ("y").ToLocalChecked(), Nan::New (xnasc [1])); @@ -1579,10 +1579,10 @@ NAN_METHOD(node_swe_nod_aps_ut) { long rflag; rflag = ::swe_nod_aps_ut ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), - (int)info [3]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), xnasc, xndsc, xperi, xaphe, serr ); @@ -1591,7 +1591,7 @@ NAN_METHOD(node_swe_nod_aps_ut) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { Local ascending = Nan::New (); ascending->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (xnasc [0])); ascending->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (xnasc [1])); @@ -1628,7 +1628,7 @@ NAN_METHOD(node_swe_nod_aps_ut) { aphelion->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (xaphe [5])); result->Set (Nan::New ("aphelion").ToLocalChecked(), aphelion); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { Local ascending = Nan::New (); ascending->Set (Nan::New ("x").ToLocalChecked(), Nan::New (xnasc [0])); ascending->Set (Nan::New ("y").ToLocalChecked(), Nan::New (xnasc [1])); diff --git a/src/hel.cc b/src/hel.cc index 2ca28eb..45ecc75 100644 --- a/src/hel.cc +++ b/src/hel.cc @@ -40,29 +40,29 @@ NAN_METHOD(node_swe_heliacal_ut) { char name [AS_MAXCH]; long rflag; - dgeo [0] = info [1]->ToObject ()->Get (0)->NumberValue (); - dgeo [1] = info [1]->ToObject ()->Get (1)->NumberValue (); - dgeo [2] = info [1]->ToObject ()->Get (2)->NumberValue (); + dgeo [0] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dgeo [1] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dgeo [2] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - datm [0] = info [2]->ToObject ()->Get (0)->NumberValue (); - datm [1] = info [2]->ToObject ()->Get (1)->NumberValue (); - datm [2] = info [2]->ToObject ()->Get (2)->NumberValue (); - datm [3] = info [2]->ToObject ()->Get (3)->NumberValue (); + datm [0] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [1] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [2] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [3] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (3)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - dobs [0] = info [3]->ToObject ()->Get (0)->NumberValue (); - dobs [1] = info [3]->ToObject ()->Get (1)->NumberValue (); - dobs [2] = info [3]->ToObject ()->Get (2)->NumberValue (); - dobs [3] = info [3]->ToObject ()->Get (3)->NumberValue (); - dobs [4] = info [3]->ToObject ()->Get (4)->NumberValue (); - dobs [5] = info [3]->ToObject ()->Get (5)->NumberValue (); + dobs [0] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [1] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [2] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [3] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (3)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [4] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (4)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [5] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (5)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - ::strcpy (name, *String::Utf8Value (info [4]->ToString ())); + ::strcpy (name, *String::Utf8Value (Isolate::GetCurrent(), info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_heliacal_ut ( - info [0]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), dgeo, datm, dobs, name, - (int)info [5]->NumberValue (), - (int)info [6]->NumberValue (), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(), dret, serr ); @@ -147,29 +147,29 @@ NAN_METHOD(node_swe_heliacal_pheno_ut) { char name [AS_MAXCH]; long rflag; - dgeo [0] = info [1]->ToObject ()->Get (0)->NumberValue (); - dgeo [1] = info [1]->ToObject ()->Get (1)->NumberValue (); - dgeo [2] = info [1]->ToObject ()->Get (2)->NumberValue (); + dgeo [0] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dgeo [1] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dgeo [2] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - datm [0] = info [2]->ToObject ()->Get (0)->NumberValue (); - datm [1] = info [2]->ToObject ()->Get (1)->NumberValue (); - datm [2] = info [2]->ToObject ()->Get (2)->NumberValue (); - datm [3] = info [2]->ToObject ()->Get (3)->NumberValue (); + datm [0] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [1] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [2] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [3] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (3)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - dobs [0] = info [3]->ToObject ()->Get (0)->NumberValue (); - dobs [1] = info [3]->ToObject ()->Get (1)->NumberValue (); - dobs [2] = info [3]->ToObject ()->Get (2)->NumberValue (); - dobs [3] = info [3]->ToObject ()->Get (3)->NumberValue (); - dobs [4] = info [3]->ToObject ()->Get (4)->NumberValue (); - dobs [5] = info [3]->ToObject ()->Get (5)->NumberValue (); + dobs [0] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [1] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [2] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [3] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (3)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [4] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (4)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [5] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (5)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - ::strcpy (name, *String::Utf8Value (info [4]->ToString ())); + ::strcpy (name, *String::Utf8Value (Isolate::GetCurrent(), info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_heliacal_ut ( - info [0]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), dgeo, datm, dobs, name, - (int)info [5]->NumberValue (), - (int)info [6]->NumberValue (), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [6]->NumberValue (Nan::GetCurrentContext()).ToChecked(), darr, serr ); @@ -257,28 +257,28 @@ NAN_METHOD(node_swe_vis_limit_mag) { char name [AS_MAXCH]; long rflag; - dgeo [0] = info [1]->ToObject ()->Get (0)->NumberValue (); - dgeo [1] = info [1]->ToObject ()->Get (1)->NumberValue (); - dgeo [2] = info [1]->ToObject ()->Get (2)->NumberValue (); + dgeo [0] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dgeo [1] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dgeo [2] = info [1]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - datm [0] = info [2]->ToObject ()->Get (0)->NumberValue (); - datm [1] = info [2]->ToObject ()->Get (1)->NumberValue (); - datm [2] = info [2]->ToObject ()->Get (2)->NumberValue (); - datm [3] = info [2]->ToObject ()->Get (3)->NumberValue (); + datm [0] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [1] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [2] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + datm [3] = info [2]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (3)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - dobs [0] = info [3]->ToObject ()->Get (0)->NumberValue (); - dobs [1] = info [3]->ToObject ()->Get (1)->NumberValue (); - dobs [2] = info [3]->ToObject ()->Get (2)->NumberValue (); - dobs [3] = info [3]->ToObject ()->Get (3)->NumberValue (); - dobs [4] = info [3]->ToObject ()->Get (4)->NumberValue (); - dobs [5] = info [3]->ToObject ()->Get (5)->NumberValue (); + dobs [0] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [1] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [2] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [3] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (3)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [4] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (4)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + dobs [5] = info [3]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (5)->NumberValue (Nan::GetCurrentContext()).ToChecked(); - ::strcpy (name, *String::Utf8Value (info [4]->ToString ())); + ::strcpy (name, *String::Utf8Value (Isolate::GetCurrent(), info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_vis_limit_mag ( - info [0]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), dgeo, datm, dobs, name, - (int)info [5]->NumberValue (), + (int)info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked(), dret, serr ); diff --git a/src/house.cc b/src/house.cc index d1a3e67..fddee58 100644 --- a/src/house.cc +++ b/src/house.cc @@ -43,7 +43,7 @@ NAN_METHOD(node_swe_houses) { Local result = Nan::New (); Local house = Nan::New (); - hsys = (* String::Utf8Value (info [3]->ToString ())) [0]; + hsys = (* String::Utf8Value (Isolate::GetCurrent(), info [3]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0]; if (hsys == 'G') { cuspsCount = 36; @@ -52,9 +52,9 @@ NAN_METHOD(node_swe_houses) { } rflag = ::swe_houses ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), hsys, cusps, ascmc ); @@ -123,7 +123,7 @@ NAN_METHOD(node_swe_houses_ex) { Local result = Nan::New (); Local house = Nan::New (); - hsys = (* String::Utf8Value (info [4]->ToString ())) [0]; + hsys = (* String::Utf8Value (Isolate::GetCurrent(), info [4]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0]; if (hsys == 'G') { cuspsCount = 36; @@ -132,10 +132,10 @@ NAN_METHOD(node_swe_houses_ex) { } rflag = ::swe_houses_ex ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - info [2]->NumberValue (), - info [3]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [3]->NumberValue (Nan::GetCurrentContext()).ToChecked(), hsys, cusps, ascmc ); @@ -203,7 +203,7 @@ NAN_METHOD(node_swe_houses_armc) { Local result = Nan::New (); Local house = Nan::New (); - hsys = (* String::Utf8Value (info [3]->ToString ())) [0]; + hsys = (* String::Utf8Value (Isolate::GetCurrent(), info [3]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0]; if (hsys == 'G') { cuspsCount = 36; @@ -212,9 +212,9 @@ NAN_METHOD(node_swe_houses_armc) { } rflag = ::swe_houses_armc ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), hsys, cusps, ascmc ); @@ -267,17 +267,17 @@ NAN_METHOD(node_swe_houses_pos) { Nan::ThrowTypeError ("Wrong type of arguments"); }; - double xpin [2] = {info [4]->NumberValue (), info [5]->NumberValue ()}; + double xpin [2] = {info [4]->NumberValue (Nan::GetCurrentContext()).ToChecked(), info [5]->NumberValue (Nan::GetCurrentContext()).ToChecked()}; char serr [AS_MAXCH]; double rflag; Local result = Nan::New (); rflag = ::swe_house_pos ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue (), - (* String::Utf8Value (info [3]->ToString ())) [0], + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (* String::Utf8Value (Isolate::GetCurrent(), info [3]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0], xpin, serr ); diff --git a/src/pos.cc b/src/pos.cc index 2706371..5e70694 100644 --- a/src/pos.cc +++ b/src/pos.cc @@ -54,9 +54,9 @@ NAN_METHOD(node_swe_calc_ut) { long rflag; rflag = ::swe_calc_ut ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), x, serr ); @@ -65,7 +65,7 @@ NAN_METHOD(node_swe_calc_ut) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { result->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (x [1])); result->Set (Nan::New ("distance").ToLocalChecked(), Nan::New (x [2])); @@ -74,7 +74,7 @@ NAN_METHOD(node_swe_calc_ut) { result->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (x [5])); result->Set (Nan::New ("rflag").ToLocalChecked(), Nan::New (rflag)); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { result->Set (Nan::New ("x").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("y").ToLocalChecked(), Nan::New (x [1])); result->Set (Nan::New ("z").ToLocalChecked(), Nan::New (x [2])); @@ -130,9 +130,9 @@ NAN_METHOD(node_swe_calc) { long rflag; rflag = ::swe_calc ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), x, serr ); @@ -141,7 +141,7 @@ NAN_METHOD(node_swe_calc) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { result->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (x [1])); result->Set (Nan::New ("distance").ToLocalChecked(), Nan::New (x [2])); @@ -150,7 +150,7 @@ NAN_METHOD(node_swe_calc) { result->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (x [5])); result->Set (Nan::New ("rflag").ToLocalChecked(), Nan::New (rflag)); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { result->Set (Nan::New ("x").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("y").ToLocalChecked(), Nan::New (x [1])); result->Set (Nan::New ("z").ToLocalChecked(), Nan::New (x [2])); @@ -207,12 +207,12 @@ NAN_METHOD(node_swe_fixstar) { long rflag = 0; char star [AS_MAXCH]; - ::strcpy (star, * String::Utf8Value (info [0]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_fixstar ( star, - info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), x, serr ); @@ -221,7 +221,7 @@ NAN_METHOD(node_swe_fixstar) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (x [1])); @@ -231,7 +231,7 @@ NAN_METHOD(node_swe_fixstar) { result->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (x [5])); result->Set (Nan::New ("rflag").ToLocalChecked(), Nan::New (rflag)); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("x").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("y").ToLocalChecked(), Nan::New (x [1])); @@ -290,12 +290,12 @@ NAN_METHOD(node_swe_fixstar_ut) { long rflag = 0; char star [AS_MAXCH]; - ::strcpy (star, *String::Utf8Value (info [0]->ToString ())); + ::strcpy (star, *String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_fixstar_ut ( star, - info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), x, serr ); @@ -304,7 +304,7 @@ NAN_METHOD(node_swe_fixstar_ut) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (x [1])); @@ -314,7 +314,7 @@ NAN_METHOD(node_swe_fixstar_ut) { result->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (x [5])); result->Set (Nan::New ("rflag").ToLocalChecked(), Nan::New (rflag)); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("x").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("y").ToLocalChecked(), Nan::New (x [1])); @@ -365,7 +365,7 @@ NAN_METHOD(node_swe_fixstar_mag) { long rflag; double magnitude; - ::strcpy (star, *String::Utf8Value (info [0]->ToString ())); + ::strcpy (star, *String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_fixstar_mag (star, &magnitude, serr); @@ -417,12 +417,12 @@ NAN_METHOD(node_swe_fixstar2) { long rflag = 0; char star [AS_MAXCH]; - ::strcpy (star, * String::Utf8Value (info [0]->ToString ())); + ::strcpy (star, * String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_fixstar2 ( star, - info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), x, serr ); @@ -431,7 +431,7 @@ NAN_METHOD(node_swe_fixstar2) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (x [1])); @@ -441,7 +441,7 @@ NAN_METHOD(node_swe_fixstar2) { result->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (x [5])); result->Set (Nan::New ("rflag").ToLocalChecked(), Nan::New (rflag)); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("x").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("y").ToLocalChecked(), Nan::New (x [1])); @@ -500,12 +500,12 @@ NAN_METHOD(node_swe_fixstar2_ut) { long rflag = 0; char star [AS_MAXCH]; - ::strcpy (star, *String::Utf8Value (info [0]->ToString ())); + ::strcpy (star, *String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_fixstar2_ut ( star, - info [1]->NumberValue (), - (int)info [2]->NumberValue (), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), x, serr ); @@ -514,7 +514,7 @@ NAN_METHOD(node_swe_fixstar2_ut) { if (rflag < 0) { result->Set (Nan::New ("error").ToLocalChecked(), Nan::New (serr).ToLocalChecked()); } else - if ((int)info [2]->NumberValue () & SEFLG_EQUATORIAL) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_EQUATORIAL) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("rectAscension").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("declination").ToLocalChecked(), Nan::New (x [1])); @@ -524,7 +524,7 @@ NAN_METHOD(node_swe_fixstar2_ut) { result->Set (Nan::New ("distanceSpeed").ToLocalChecked(), Nan::New (x [5])); result->Set (Nan::New ("rflag").ToLocalChecked(), Nan::New (rflag)); } else - if ((int)info [2]->NumberValue () & SEFLG_XYZ) { + if ((int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() & SEFLG_XYZ) { result->Set (Nan::New ("name").ToLocalChecked(), Nan::New (star).ToLocalChecked()); result->Set (Nan::New ("x").ToLocalChecked(), Nan::New (x [0])); result->Set (Nan::New ("y").ToLocalChecked(), Nan::New (x [1])); @@ -575,7 +575,7 @@ NAN_METHOD(node_swe_fixstar2_mag) { long rflag; double magnitude; - ::strcpy (star, *String::Utf8Value (info [0]->ToString ())); + ::strcpy (star, *String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))); rflag = ::swe_fixstar2_mag (star, &magnitude, serr); @@ -625,10 +625,10 @@ NAN_METHOD(node_swe_set_ephe_path) { }; ::swe_set_ephe_path ( - *String::Utf8Value (info [0]->ToString ()) + *String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local())) ); - Local result = info [0]->ToObject (); + Local result = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local()); HandleCallback (info, result); info.GetReturnValue().Set (result); @@ -653,10 +653,10 @@ NAN_METHOD(node_swe_set_jpl_file) { }; ::swe_set_jpl_file ( - *String::Utf8Value (info [0]->ToString ()) + *String::Utf8Value (Isolate::GetCurrent(), info [0]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local())) ); - Local result = info [0]->ToObject (); + Local result = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local()); HandleCallback (info, result); info.GetReturnValue().Set (result); @@ -684,7 +684,7 @@ NAN_METHOD(node_swe_get_planet_name) { char name [AS_MAXCH] = {0}; - ::swe_get_planet_name ((int)info [0]->NumberValue (), name); + ::swe_get_planet_name ((int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), name); Local result = Nan::New (); @@ -715,9 +715,9 @@ NAN_METHOD(node_swe_set_topo) { }; ::swe_set_topo ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); HandleCallback (info, Nan::Undefined()); @@ -745,9 +745,9 @@ NAN_METHOD(node_swe_set_sid_mode) { }; ::swe_set_sid_mode ( - (int)info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); HandleCallback (info, Nan::Undefined()); @@ -775,7 +775,7 @@ NAN_METHOD(node_swe_get_ayanamsa) { double val; val = ::swe_get_ayanamsa ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (val); @@ -805,7 +805,7 @@ NAN_METHOD(node_swe_get_ayanamsa_ut) { double val; val = ::swe_get_ayanamsa_ut ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (val); @@ -842,8 +842,8 @@ NAN_METHOD(node_swe_get_ayanamsa_ex) { long val; val = ::swe_get_ayanamsa_ex ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), daya, serr ); @@ -886,8 +886,8 @@ NAN_METHOD(node_swe_get_ayanamsa_ex_ut) { long val; val = ::swe_get_ayanamsa_ex_ut ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), daya, serr ); @@ -923,7 +923,7 @@ NAN_METHOD(node_swe_get_ayanamsa_name) { const char * val; val = ::swe_get_ayanamsa_name ( - (int)info [0]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (val).ToLocalChecked(); diff --git a/src/swisseph.h b/src/swisseph.h index c78604c..9c6fab5 100644 --- a/src/swisseph.h +++ b/src/swisseph.h @@ -1,7 +1,7 @@ #ifndef __swisseph_swisseph_h__ #define __swisseph_swisseph_h__ -#pragma warning (disable : 4251) +//#pragma warning (disable : 4251) #include #include diff --git a/src/util.cc b/src/util.cc index f907b2a..e3ce101 100644 --- a/src/util.cc +++ b/src/util.cc @@ -25,7 +25,7 @@ NAN_METHOD(node_swe_deltat) { double deltat; deltat = ::swe_deltat ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -62,7 +62,7 @@ NAN_METHOD(node_swe_time_equ) { long rflag; rflag = ::swe_time_equ ( - info [0]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &te, serr ); @@ -103,9 +103,9 @@ NAN_METHOD(node_swe_sidtime0) { double st; st = ::swe_sidtime0 ( - info [0]->NumberValue (), - info [1]->NumberValue (), - info [2]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -139,7 +139,7 @@ NAN_METHOD(node_swe_sidtime) { double st; st = ::swe_sidtime ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -176,13 +176,13 @@ NAN_METHOD(node_swe_cotrans) { double xpn [3] = {0}; double xpo [3] = {0}; - xpo [0] = info [0]->ToObject ()->Get (0)->NumberValue (); - xpo [1] = info [0]->ToObject ()->Get (1)->NumberValue (); - xpo [2] = info [0]->ToObject ()->Get (2)->NumberValue (); + xpo [0] = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xpo [1] = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xpo [2] = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); ::swe_cotrans ( xpo, xpn, - info [1]->NumberValue () + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -221,13 +221,13 @@ NAN_METHOD(node_swe_cotrans_sp) { double xpn [3] = {0}; double xpo [3] = {0}; - xpo [0] = info [0]->ToObject ()->Get (0)->NumberValue (); - xpo [1] = info [0]->ToObject ()->Get (1)->NumberValue (); - xpo [2] = info [0]->ToObject ()->Get (2)->NumberValue (); + xpo [0] = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (0)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xpo [1] = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (1)->NumberValue (Nan::GetCurrentContext()).ToChecked(); + xpo [2] = info [0]->ToObject (Nan::GetCurrentContext()).FromMaybe(v8::Local())->Get (2)->NumberValue (Nan::GetCurrentContext()).ToChecked(); ::swe_cotrans_sp ( xpo, xpn, - info [1]->NumberValue () + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -282,7 +282,7 @@ NAN_METHOD(node_swe_set_tid_acc) { }; ::swe_set_tid_acc ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -314,7 +314,7 @@ NAN_METHOD(node_swe_degnorm) { double x360; x360 = ::swe_degnorm ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -348,7 +348,7 @@ NAN_METHOD(node_swe_radnorm) { double x2Pi; x2Pi = ::swe_radnorm ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -383,8 +383,8 @@ NAN_METHOD(node_swe_rad_midp) { double xMid2Pi; xMid2Pi = ::swe_rad_midp ( - info [0]->NumberValue (), - info [1]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -419,8 +419,8 @@ NAN_METHOD(node_swe_deg_midp) { double xMid360; xMid360 = ::swe_deg_midp ( - info [0]->NumberValue (), - info [1]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -463,8 +463,8 @@ NAN_METHOD(node_swe_split_deg) { int isgn; ::swe_split_deg ( - info [0]->NumberValue (), - (int)info [1]->NumberValue (), + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), &ideg, &imin, &isec, &dsecfr, &isgn ); @@ -503,7 +503,7 @@ NAN_METHOD(node_swe_csnorm) { int centisec360; centisec360 = ::swe_csnorm ( - (int)info [0]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -538,8 +538,8 @@ NAN_METHOD(node_swe_difcsn ) { int centisecDiff; centisecDiff = ::swe_difcsn ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -574,8 +574,8 @@ NAN_METHOD(node_swe_difdegn ) { double degreeDiff; degreeDiff = ::swe_difdegn ( - info [0]->NumberValue (), - info [1]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -610,8 +610,8 @@ NAN_METHOD(node_swe_difcs2n) { int centisecDistance180; centisecDistance180 = ::swe_difcs2n ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -646,8 +646,8 @@ NAN_METHOD(node_swe_difdeg2n) { double degreeDistance180; degreeDistance180 = ::swe_difdeg2n ( - info [0]->NumberValue (), - info [1]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -682,8 +682,8 @@ NAN_METHOD(node_swe_difrad2n) { double degreeDistancePi; degreeDistancePi = ::swe_difrad2n ( - info [0]->NumberValue (), - info [1]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -717,7 +717,7 @@ NAN_METHOD(node_swe_csroundsec) { int centisecRound; centisecRound = ::swe_csroundsec ( - (int)info [0]->NumberValue () + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -751,7 +751,7 @@ NAN_METHOD(node_swe_d2l) { int xRound; xRound = ::swe_d2l ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -785,7 +785,7 @@ NAN_METHOD(node_swe_day_of_week) { int dayOfWeek; dayOfWeek = ::swe_day_of_week ( - info [0]->NumberValue () + info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked() ); Local result = Nan::New (); @@ -821,9 +821,9 @@ NAN_METHOD(node_swe_cs2timestr) { char timeString [AS_MAXCH] = {0}; ::swe_cs2timestr ( - (int)info [0]->NumberValue (), - (int)info [1]->NumberValue (), - (int)info [2]->NumberValue (), + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [1]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (int)info [2]->NumberValue (Nan::GetCurrentContext()).ToChecked(), timeString ); @@ -860,9 +860,9 @@ NAN_METHOD(node_swe_cs2lonlatstr) { char lonlatString [AS_MAXCH] = {0}; ::swe_cs2lonlatstr ( - (int)info [0]->NumberValue (), - (* String::Utf8Value (info [1]->ToString ())) [0], - (* String::Utf8Value (info [2]->ToString ())) [0], + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), + (* String::Utf8Value (Isolate::GetCurrent(), info [1]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0], + (* String::Utf8Value (Isolate::GetCurrent(), info [2]->ToString (Nan::GetCurrentContext()).FromMaybe(v8::Local()))) [0], lonlatString ); @@ -897,7 +897,7 @@ NAN_METHOD(node_swe_cs2degstr) { char degreeString [AS_MAXCH] = {0}; ::swe_cs2degstr ( - (int)info [0]->NumberValue (), + (int)info [0]->NumberValue (Nan::GetCurrentContext()).ToChecked(), degreeString );