Changeset 14695 for trunk/FACT++/src


Ignore:
Timestamp:
11/25/12 13:35:14 (12 years ago)
Author:
tbretz
Message:
Throw an exception if the expected Date argument is not a Date
File:
1 edited

Legend:

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

    r14694 r14695  
    13151315        return ThrowException(String::New("toSky must not be called with more than one argument."));
    13161316
     1317    if (args.Length()==1 && !args[0]->IsDate())
     1318        return ThrowException(String::New("Argument must be a Date"));
     1319
    13171320    ln_hrz_posn hrz;
    13181321    hrz.alt = 90-GetDataMember(args, "zd");
     
    13501353        return ThrowException(String::New("toLocal must not be called with more than one argument."));
    13511354
     1355    if (args.Length()==1 && !args[0]->IsDate())
     1356        return ThrowException(String::New("Argument must be a Date"));
     1357
    13521358    ln_equ_posn equ;
    13531359    equ.ra  = GetDataMember(args, "ra")*15;
     
    14141420    if (args.Length()>1)
    14151421        return ThrowException(String::New("Moon constructor must not be called with more than one argument."));
     1422
     1423    if (args.Length()==1 && !args[0]->IsDate())
     1424        return ThrowException(String::New("Argument must be a Date"));
    14161425
    14171426    HandleScope handle_scope;
     
    15531562    if (args.Length()>2)
    15541563        return ThrowException(String::New("Sun.horizon must not be called with one or two arguments."));
     1564
     1565    if (args.Length()==2 && !args[1]->IsDate())
     1566        return ThrowException(String::New("Second argument must be a Date"));
    15551567
    15561568    HandleScope handle_scope;
     
    16071619    if (args.Length()>1)
    16081620        return ThrowException(String::New("Moon.horizon must not be called with one argument."));
     1621
     1622    if (args.Length()==1 && !args[0]->IsDate())
     1623        return ThrowException(String::New("Argument must be a Date"));
    16091624
    16101625    HandleScope handle_scope;
Note: See TracChangeset for help on using the changeset viewer.