Changeset 14693 for trunk/FACT++/src


Ignore:
Timestamp:
11/25/12 13:18:37 (12 years ago)
Author:
tbretz
Message:
Exchanged the arguments to Sun.horizon
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r14692 r14693  
    15571557
    15581558    double hrz = NAN;
    1559     if (args.Length()<2)
     1559    if (args.Length()==0 || args[0]->IsNull())
    15601560        hrz = LN_SOLAR_STANDART_HORIZON;
    1561     if (args.Length()==2 && args[1]->IsNumber())
    1562         hrz = args[1]->NumberValue();
    1563     if (args.Length()==2 && args[1]->IsString())
    1564     {
    1565         string arg(Tools::Trim(*String::AsciiValue(args[1])));
     1561    if (args.Length()>0 && args[0]->IsNumber())
     1562        hrz = args[0]->NumberValue();
     1563    if (args.Length()>0 && args[0]->IsString())
     1564    {
     1565        string arg(Tools::Trim(*String::AsciiValue(args[0])));
    15661566        transform(arg.begin(), arg.end(), arg.begin(), ::tolower);
    15671567
     
    15801580
    15811581    const Local<Value> date =
    1582         args.Length()==0 ? Date::New(Time().JavaDate()) : args[0];
     1582        args.Length()<2 ? Date::New(Time().JavaDate()) : args[1];
    15831583    if (date.IsEmpty())
    15841584        return Undefined();
Note: See TracChangeset for help on using the changeset viewer.