Changeset 16071 for trunk/FACT++
- Timestamp:
- 05/23/13 11:08:38 (11 years ago)
- Location:
- trunk/FACT++
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/scripts/doc/console.js
r14699 r16071 31 31 */ 32 32 console.out = function() { /* [native code] */ } 33 34 /** 35 * 36 * Displays a warning message on the local console (only). 37 * 38 * (This is mainly meant for debugging purpose to highlight warning 39 * messages.) 40 * 41 * @param argument 42 * Any kind of argument can be given. If it is not a String, it 43 * is converted using the toString() member function. 44 * 45 * @param [. . .] 46 * Any number of additional arguments. Each argument will appear in 47 * a new line. 48 * 49 * @example 50 * console.warn("WARNING: Five="+5, "--- new line ---"); 51 * 52 */ 53 console.warn = function() { /* [native code] */ } -
trunk/FACT++/src/InterpreterV8.cc
r15430 r16071 677 677 if (*str) 678 678 JsOut(*str); 679 } 680 return Undefined(); 681 } 682 683 Handle<Value> InterpreterV8::FuncWarn(const Arguments& args) 684 { 685 for (int i=0; i<args.Length(); i++) 686 { 687 const String::AsciiValue str(args[i]); 688 if (*str) 689 JsWarn(*str); 679 690 } 680 691 return Undefined(); … … 2420 2431 Handle<ObjectTemplate> console = ObjectTemplate::New(); 2421 2432 console->Set(String::New("out"), FunctionTemplate::New(WrapOut), ReadOnly); 2433 console->Set(String::New("warn"), FunctionTemplate::New(WrapWarn), ReadOnly); 2422 2434 2423 2435 Handle<ObjectTemplate> onchange = ObjectTemplate::New(); -
trunk/FACT++/src/InterpreterV8.h
r15430 r16071 78 78 v8::Handle<v8::Value> FuncAlarm(const v8::Arguments& args); 79 79 v8::Handle<v8::Value> FuncOut(const v8::Arguments& args); 80 v8::Handle<v8::Value> FuncWarn(const v8::Arguments& args); 80 81 v8::Handle<v8::Value> FuncFile(const v8::Arguments& args); 81 82 v8::Handle<v8::Value> FuncSendMail(const v8::Arguments& args); … … 132 133 static v8::Handle<v8::Value> WrapAlarm(const v8::Arguments &args) { if (This) return This->FuncAlarm(args); else return v8::Undefined(); } 133 134 static v8::Handle<v8::Value> WrapOut(const v8::Arguments &args) { if (This) return This->FuncOut(args); else return v8::Undefined(); } 135 static v8::Handle<v8::Value> WrapWarn(const v8::Arguments &args) { if (This) return This->FuncWarn(args); else return v8::Undefined(); } 134 136 static v8::Handle<v8::Value> WrapWait(const v8::Arguments &args) { if (This) return This->FuncWait(args); else return v8::Undefined(); } 135 137 static v8::Handle<v8::Value> WrapSend(const v8::Arguments &args) { if (This) return This->FuncSend(args); else return v8::Undefined(); } … … 187 189 virtual void JsAlarm(const std::string & = "") { } 188 190 virtual void JsOut(const std::string &) { } 191 virtual void JsWarn(const std::string &) { } 189 192 virtual void JsResult(const std::string &) { } 190 193 virtual void JsException(const std::string &) { } -
trunk/FACT++/src/RemoteControl.h
r15430 r16071 166 166 void JsEnd(const std::string &) { UnsubscribeAll(); InterpreterV8::JsEnd(); SetSection(-4); } 167 167 bool JsSend(const std::string &str) { return ProcessCommand(str, false); } 168 void JsOut(const std::string &msg) { lin << msg << endl; } 168 void JsOut(const std::string &msg) { lin << kDefault << msg << endl; } 169 void JsWarn(const std::string &msg) { lin << kYellow << msg << endl; } 169 170 void JsResult(const std::string &msg) { if (msg!="use strict") lin << kBlue << " = " << msg << '\n' << endl; } 170 171 void JsPrint(const std::string &msg) { if (fImp) fImp->Comment(msg); }
Note:
See TracChangeset
for help on using the changeset viewer.