Changeset 18978 for trunk/FACT++
- Timestamp:
- 04/05/18 19:00:31 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/InterpreterV8.cc
r18840 r18978 13 13 14 14 #ifdef HAVE_NOVA 15 #include " externals/nova.h"15 #include "nova.h" 16 16 #endif 17 17 … … 25 25 #include "tools.h" 26 26 #include "Readline.h" 27 #include " externals/izstream.h"27 #include "izstream.h" 28 28 29 29 #include "WindowLog.h" … … 157 157 const int nn = args.Length()==2 ? 0 : args.Length()-3; 158 158 159 Handle<Value> argv[nn];159 vector<Handle<Value>> argv(nn); 160 160 for (int i=0; i<nn; i++) 161 161 argv[i] = args[i+3]; … … 164 164 while (1) 165 165 { 166 const Handle<Value> rc = args.Length()<3 ? func->Call(func, nn, argv) : func->Call(args[2]->ToObject(), nn, argv); 166 const Handle<Value> rc = args.Length()<3 ? 167 func->Call(func, nn, argv.data()) : 168 func->Call(args[2]->ToObject(), nn, argv.data()); 169 167 170 if (rc.IsEmpty()) 168 171 return Undefined(); … … 628 631 string arg0 = args.Length() ? *String::AsciiValue(args[0]) : ""; 629 632 if (arg0=="*") 630 arg0= ="";633 arg0=""; 631 634 632 635 const set<Service> services = JsGetServices(); … … 1187 1190 return ThrowException(String::New(e.what())); 1188 1191 } 1192 #else 1193 return Undefined(); 1189 1194 #endif 1190 1195 } … … 1227 1232 return ThrowException(String::New(e.what())); 1228 1233 } 1234 #else 1235 return Undefined(); 1229 1236 #endif 1230 1237 } … … 2199 2206 obj->Set(String::New("observatory"), String::New(args.obs.c_str()), ReadOnly); 2200 2207 2201 const bool isUp = rc>0 ||2208 const bool isUp = 2202 2209 (rst.rise<rst.set && (args.jd>rst.rise && args.jd<rst.set)) || 2203 2210 (rst.rise>rst.set && (args.jd<rst.set || args.jd>rst.rise)); 2204 2211 2205 obj->Set(String::New("isUp"), Boolean::New( rc>=0 &&isUp), ReadOnly);2206 2207 if ( rc!=0)2212 obj->Set(String::New("isUp"), Boolean::New(isUp), ReadOnly); 2213 2214 if (!rc) // circumpolar 2208 2215 return obj; 2209 2216 … … 2261 2268 2262 2269 ln_rst_time sun; 2263 const int rc = ln_get_solar_rst_horizon(local.jd-0.5, &local.posn, hrz, &sun);2270 const bool rc = ln_get_solar_rst_horizon(local.jd-0.5, &local.posn, hrz, &sun)==0; 2264 2271 Handle<Object> rst = ConstructRiseSet(local, sun, rc); 2265 2272 rst->Set(String::New("horizon"), Number::New(hrz)); … … 2282 2289 2283 2290 ln_rst_time moon; 2284 const int rc = ln_get_lunar_rst(local.jd-0.5, &local.posn, &moon);2291 const bool rc = ln_get_lunar_rst(local.jd-0.5, &local.posn, &moon)==0; 2285 2292 Handle<Object> rst = ConstructRiseSet(local, moon, rc); 2286 2293 return handle_scope.Close(rst); … … 2551 2558 Handle<Value> InterpreterV8::Constructor(/*Handle<FunctionTemplate> T,*/ const Arguments &args) 2552 2559 { 2553 Handle<Value> argv[args.Length()];2560 vector<Handle<Value>> argv(args.Length()); 2554 2561 2555 2562 for (int i=0; i<args.Length(); i++) 2556 2563 argv[i] = args[i]; 2557 2564 2558 return args.Callee()->NewInstance(args.Length(), argv );2565 return args.Callee()->NewInstance(args.Length(), argv.data()); 2559 2566 } 2560 2567
Note:
See TracChangeset
for help on using the changeset viewer.