Rev 1042 | Rev 1203 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1042 | Rev 1060 | ||
|---|---|---|---|
| Line 95... | Line 95... | ||
| 95 | myGlobal->Set(String::New("bin2float"), FunctionTemplate::New(VirtualMachine::_bin2float)); |
95 | myGlobal->Set(String::New("bin2float"), FunctionTemplate::New(VirtualMachine::_bin2float)); |
| 96 | myGlobal->Set(String::New("float2bin"), FunctionTemplate::New(VirtualMachine::_float2bin)); |
96 | myGlobal->Set(String::New("float2bin"), FunctionTemplate::New(VirtualMachine::_float2bin)); |
| 97 | myGlobal->Set(String::New("bin2uint"), FunctionTemplate::New(VirtualMachine::_bin2uint)); |
97 | myGlobal->Set(String::New("bin2uint"), FunctionTemplate::New(VirtualMachine::_bin2uint)); |
| 98 | myGlobal->Set(String::New("uint2bin"), FunctionTemplate::New(VirtualMachine::_uint2bin)); |
98 | myGlobal->Set(String::New("uint2bin"), FunctionTemplate::New(VirtualMachine::_uint2bin)); |
| 99 | myGlobal->Set(String::New("hex2uint"), FunctionTemplate::New(VirtualMachine::_hex2uint)); |
99 | myGlobal->Set(String::New("hex2uint"), FunctionTemplate::New(VirtualMachine::_hex2uint)); |
| - | 100 | myGlobal->Set(String::New("sleep"), FunctionTemplate::New(VirtualMachine::_sleep)); |
|
| 100 | myContext = Context::New(NULL, myGlobal); |
101 | myContext = Context::New(NULL, myGlobal); |
| 101 | 102 | ||
| 102 | 103 | ||
| 103 | if (loadScript("System/Base.js")) |
104 | if (loadScript("System/Base.js")) |
| 104 | { |
105 | { |
| Line 639... | Line 640... | ||
| 639 | Handle<Value> VirtualMachine::_hex2uint(const Arguments& args) |
640 | Handle<Value> VirtualMachine::_hex2uint(const Arguments& args) |
| 640 | { |
641 | { |
| 641 | String::AsciiValue hex(args[0]); |
642 | String::AsciiValue hex(args[0]); |
| 642 | unsigned int num = hex2uint(*hex); |
643 | unsigned int num = hex2uint(*hex); |
| 643 | return Number::New(num); |
644 | return Number::New(num); |
| - | 645 | } |
|
| - | 646 | ||
| - | 647 | Handle<Value> VirtualMachine::_sleep(const Arguments& args) |
|
| - | 648 | { |
|
| - | 649 | usleep(args[0]->Uint32Value()); |
|
| - | 650 | return Undefined(); |
|
| 644 | } |
651 | } |