| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 } | 442 } |
| 443 | 443 |
| 444 #endif // No waitid call. | 444 #endif // No waitid call. |
| 445 | 445 |
| 446 return true; | 446 return true; |
| 447 } | 447 } |
| 448 | 448 |
| 449 | 449 |
| 450 // Implementation of the system() function (see d8.h for details). | 450 // Implementation of the system() function (see d8.h for details). |
| 451 Handle<Value> Shell::System(const Arguments& args) { | 451 Handle<Value> Shell::System(const Arguments& args) { |
| 452 HandleScope scope; | 452 HandleScope scope(args.GetIsolate()); |
| 453 int read_timeout = -1; | 453 int read_timeout = -1; |
| 454 int total_timeout = -1; | 454 int total_timeout = -1; |
| 455 if (!GetTimeouts(args, &read_timeout, &total_timeout)) return v8::Undefined(); | 455 if (!GetTimeouts(args, &read_timeout, &total_timeout)) return v8::Undefined(); |
| 456 Handle<Array> command_args; | 456 Handle<Array> command_args; |
| 457 if (args.Length() > 1) { | 457 if (args.Length() > 1) { |
| 458 if (!args[1]->IsArray()) { | 458 if (!args[1]->IsArray()) { |
| 459 return ThrowException(String::New("system: Argument 2 must be an array")); | 459 return ThrowException(String::New("system: Argument 2 must be an array")); |
| 460 } | 460 } |
| 461 command_args = Handle<Array>::Cast(args[1]); | 461 command_args = Handle<Array>::Cast(args[1]); |
| 462 } else { | 462 } else { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 os_templ->Set(String::New("chdir"), FunctionTemplate::New(ChangeDirectory)); | 679 os_templ->Set(String::New("chdir"), FunctionTemplate::New(ChangeDirectory)); |
| 680 os_templ->Set(String::New("setenv"), FunctionTemplate::New(SetEnvironment)); | 680 os_templ->Set(String::New("setenv"), FunctionTemplate::New(SetEnvironment)); |
| 681 os_templ->Set(String::New("unsetenv"), | 681 os_templ->Set(String::New("unsetenv"), |
| 682 FunctionTemplate::New(UnsetEnvironment)); | 682 FunctionTemplate::New(UnsetEnvironment)); |
| 683 os_templ->Set(String::New("umask"), FunctionTemplate::New(SetUMask)); | 683 os_templ->Set(String::New("umask"), FunctionTemplate::New(SetUMask)); |
| 684 os_templ->Set(String::New("mkdirp"), FunctionTemplate::New(MakeDirectory)); | 684 os_templ->Set(String::New("mkdirp"), FunctionTemplate::New(MakeDirectory)); |
| 685 os_templ->Set(String::New("rmdir"), FunctionTemplate::New(RemoveDirectory)); | 685 os_templ->Set(String::New("rmdir"), FunctionTemplate::New(RemoveDirectory)); |
| 686 } | 686 } |
| 687 | 687 |
| 688 } // namespace v8 | 688 } // namespace v8 |
| OLD | NEW |