Changeset 17498 for trunk/FACT++/src
- Timestamp:
- 01/07/14 16:11:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/InterpreterV8.cc
r17213 r17498 362 362 const string state = args[1]->IsString() ? *String::AsciiValue(args[1]) : ""; 363 363 const string arg1 = args[1]->IsString() ? ("\""+state+"\"") : to_string(args[1]->Int32Value()); 364 const bool isNot = arg0[0]=='!'; 365 const string name = isNot ? arg0.substr(1) : arg0; 364 366 365 367 if (arg0.find_first_of("\"'")!=string::npos) … … 377 379 "{" 378 380 "var s = dim.state(name);" 379 "if(!s)throw new Error('Waiting for state "+arg1+" of server "+arg0+" failed.');" 381 "if(!s)throw new Error('Waiting for state "+arg1+" of server "+arg0+" failed.');"; 382 if (isNot) 383 "if(state=="+index+")return true;"; 384 else 380 385 "if(state=="+index+")return true;"; 381 386 if (timeout) … … 387 392 code += "if(ms>0)throw new Error('Waiting for state "+arg1+" of server "+arg0+" timed out.');"; 388 393 code += "return false;" 389 "})('"+ arg0+"',"+arg1;394 "})('"+name+"',"+arg1; 390 395 if (timeout) 391 396 code += "," + (args[2]->IsUndefined()?"undefined":to_string(args[2]->Int32Value()));
Note:
See TracChangeset
for help on using the changeset viewer.