Changeset 17498
- Timestamp:
- 01/07/14 16:11:13 (11 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/doc/dim.js
r15151 r17498 115 115 * @param {String} name 116 116 * The name of the server of which you want to wait for a state. 117 * The name must not contain quotation marks. 117 * The name must not contain quotation marks. To wait for 118 * "not the given state", prefix the server name with an 119 * exclamation mark, e.g. "!DIM_CONTROL" 118 120 * 119 121 * @param {String,Integer} state -
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.