Rev 1603 | Rev 1608 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1603 | Rev 1604 | ||
|---|---|---|---|
| Line 18... | Line 18... | ||
| 18 | * |
18 | * |
| 19 | */ |
19 | */ |
| 20 | 20 | ||
| 21 | #include "System.h" |
21 | #include "System.h" |
| 22 | 22 | ||
| 23 | #include <v8.h> |
23 | #include <v8-debug.h> |
| 24 | #include <stdio.h> |
24 | #include <stdio.h> |
| 25 | 25 | ||
| 26 | #include "vm/Manager.h" |
26 | #include "vm/Manager.h" |
| 27 | 27 | ||
| 28 | namespace atom { |
28 | namespace atom { |
| Line 54... | Line 54... | ||
| 54 | this->Call("Start", ArgumentListPointer(new ArgumentList)); |
54 | this->Call("Start", ArgumentListPointer(new ArgumentList)); |
| 55 | } |
55 | } |
| 56 | 56 | ||
| 57 | Value System::Export_Log(const v8::Arguments& args) |
57 | Value System::Export_Log(const v8::Arguments& args) |
| 58 | { |
58 | { |
| - | 59 | if (args.Length() < 1) |
|
| - | 60 | { |
|
| - | 61 | LOG.Error("To few arguments to log."); |
|
| - | 62 | } |
|
| - | 63 | ||
| 59 | v8::String::AsciiValue str(args[0]); |
64 | v8::String::AsciiValue str(args[0]); |
| 60 | 65 | ||
| 61 | LOG.Info(*str); |
66 | LOG.Info(*str); |
| 62 | 67 | ||
| 63 | return v8::Undefined(); |
68 | return v8::Undefined(); |
| 64 | } |
69 | } |
| 65 | 70 | ||
| 66 | Value System::Export_LoadScript(const v8::Arguments& args) |
71 | Value System::Export_LoadScript(const v8::Arguments& args) |
| 67 | { |
72 | { |
| - | 73 | LOG.Debug(std::string(__FUNCTION__) + " called!"); |
|
| - | 74 | ||
| - | 75 | if (args.Length() < 1) |
|
| - | 76 | { |
|
| - | 77 | LOG.Error("To few arguments."); |
|
| - | 78 | } |
|
| - | 79 | ||
| 68 | v8::String::AsciiValue str(args[0]); |
80 | v8::String::AsciiValue str(args[0]); |
| 69 | 81 | ||
| 70 | return v8::Boolean::New(Manager::Instance()->LoadScriptHandler(*str)); |
82 | return v8::Boolean::New(Manager::Instance()->LoadScriptHandler(*str)); |
| 71 | } |
83 | } |
| 72 | 84 | ||
| 73 | Value System::Export_Execute(const v8::Arguments& args) |
85 | Value System::Export_Execute(const v8::Arguments& args) |
| 74 | { |
86 | { |
| - | 87 | LOG.Debug(std::string(__FUNCTION__) + " called!"); |
|
| - | 88 | ||
| - | 89 | if (args.Length() < 1) |
|
| - | 90 | { |
|
| - | 91 | LOG.Error("To few arguments."); |
|
| - | 92 | } |
|
| - | 93 | ||
| 75 | v8::String::AsciiValue command(args[0]); |
94 | v8::String::AsciiValue command(args[0]); |
| 76 | 95 | ||
| 77 | std::string output_buffer; |
96 | std::string output_buffer; |
| 78 | char output[128]; |
97 | char output[128]; |
| 79 | 98 | ||