Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: src/d8.h

Issue 57005: Add os.chdir and os.setenv to d8. Move system() to os.system(). (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.h
===================================================================
--- src/d8.h (revision 1633)
+++ src/d8.h (working copy)
@@ -130,9 +130,12 @@
static Handle<Value> Quit(const Arguments& args);
static Handle<Value> Version(const Arguments& args);
static Handle<Value> Load(const Arguments& args);
- // system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will run
- // the command, passing the arguments to the program. The standard output of
- // the program will be picked up and returned as a multiline string. If
+ // The OS object on the global object contains methods for performing
+ // operating system calls:
+ //
+ // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will
+ // run the command, passing the arguments to the program. The standard output
+ // of the program will be picked up and returned as a multiline string. If
// timeout1 is present then it should be a number. -1 indicates no timeout
// and a positive number is used as a timeout in milliseconds that limits the
// time spent waiting between receiving output characters from the program.
@@ -140,7 +143,16 @@
// milliseconds on the total running time of the program. Exceptions are
// thrown on timeouts or other errors or if the exit status of the program
// indicates an error.
+ //
+ // os.chdir(dir) changes directory to the given directory. Throws an
+ // exception/ on error.
+ //
+ // os.setenv(variable, value) sets an environment variable. Repeated calls to
+ // this method leak memory due to the API of setenv in the standard C library.
+ static Handle<Value> OSObject(const Arguments& args);
static Handle<Value> System(const Arguments& args);
+ static Handle<Value> ChangeDirectory(const Arguments& args);
+ static Handle<Value> SetEnvironment(const Arguments& args);
static Handle<Context> utility_context() { return utility_context_; }
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698