Changeset 15141


Ignore:
Timestamp:
03/23/13 20:08:51 (12 years ago)
Author:
tbretz
Message:
Allow null as third argument in dim.wait; return undefined in by include.
File:
1 edited

Legend:

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

    r15140 r15141  
    330330        return ThrowException(String::New("Argument 2 not an int32 and not a string."));
    331331
    332     if (args.Length()==3 && !args[2]->IsInt32())
    333         return ThrowException(String::New("Argument 3 not an int32."));
     332    if (args.Length()==3 && !args[2]->IsInt32() && !args[2]->IsNull())
     333        return ThrowException(String::New("Argument 3 not an int32 and not null."));
    334334
    335335    // Using a Javascript function has the advantage that it is fully
     
    337337
    338338    const string index   = args[1]->IsInt32() ? "s.index" : "s.name";
    339     const bool   timeout = args.Length()==3;
     339    const bool   timeout = args.Length()==3 && !args[2]->IsNull();
    340340    const string arg0    = *String::AsciiValue(args[0]);
    341341    const string state   = args[1]->IsString() ? *String::AsciiValue(args[1]) : "";
     
    368368                   "})('"+arg0+"',"+arg1;
    369369    if (timeout)
    370         code +=    "," + to_string(args[2]->Int32Value());
     370        code +=    "," + (args[2]->IsNull()?"undefined":to_string(args[2]->Int32Value()));
    371371    code +=        ");";
    372372
     
    714714    }
    715715
    716     return Boolean::New(true);
     716    return Undefined();//Boolean::New(true);
    717717}
    718718
Note: See TracChangeset for help on using the changeset viewer.