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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/d8.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 static Handle<Array> GetCompletions(Handle<String> text, 123 static Handle<Array> GetCompletions(Handle<String> text,
124 Handle<String> full); 124 Handle<String> full);
125 static Handle<Object> DebugMessageDetails(Handle<String> message); 125 static Handle<Object> DebugMessageDetails(Handle<String> message);
126 static Handle<Value> DebugCommandToJSONRequest(Handle<String> command); 126 static Handle<Value> DebugCommandToJSONRequest(Handle<String> command);
127 127
128 static Handle<Value> Print(const Arguments& args); 128 static Handle<Value> Print(const Arguments& args);
129 static Handle<Value> Yield(const Arguments& args); 129 static Handle<Value> Yield(const Arguments& args);
130 static Handle<Value> Quit(const Arguments& args); 130 static Handle<Value> Quit(const Arguments& args);
131 static Handle<Value> Version(const Arguments& args); 131 static Handle<Value> Version(const Arguments& args);
132 static Handle<Value> Load(const Arguments& args); 132 static Handle<Value> Load(const Arguments& args);
133 // system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will run 133 // The OS object on the global object contains methods for performing
134 // the command, passing the arguments to the program. The standard output of 134 // operating system calls:
135 // the program will be picked up and returned as a multiline string. If 135 //
136 // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will
137 // run the command, passing the arguments to the program. The standard output
138 // of the program will be picked up and returned as a multiline string. If
136 // timeout1 is present then it should be a number. -1 indicates no timeout 139 // timeout1 is present then it should be a number. -1 indicates no timeout
137 // and a positive number is used as a timeout in milliseconds that limits the 140 // and a positive number is used as a timeout in milliseconds that limits the
138 // time spent waiting between receiving output characters from the program. 141 // time spent waiting between receiving output characters from the program.
139 // timeout2, if present, should be a number indicating the limit in 142 // timeout2, if present, should be a number indicating the limit in
140 // milliseconds on the total running time of the program. Exceptions are 143 // milliseconds on the total running time of the program. Exceptions are
141 // thrown on timeouts or other errors or if the exit status of the program 144 // thrown on timeouts or other errors or if the exit status of the program
142 // indicates an error. 145 // indicates an error.
146 //
147 // os.chdir(dir) changes directory to the given directory. Throws an
148 // exception/ on error.
149 //
150 // os.setenv(variable, value) sets an environment variable. Repeated calls to
151 // this method leak memory due to the API of setenv in the standard C library.
152 static Handle<Value> OSObject(const Arguments& args);
143 static Handle<Value> System(const Arguments& args); 153 static Handle<Value> System(const Arguments& args);
154 static Handle<Value> ChangeDirectory(const Arguments& args);
155 static Handle<Value> SetEnvironment(const Arguments& args);
144 156
145 static Handle<Context> utility_context() { return utility_context_; } 157 static Handle<Context> utility_context() { return utility_context_; }
146 158
147 static const char* kHistoryFileName; 159 static const char* kHistoryFileName;
148 static const char* kPrompt; 160 static const char* kPrompt;
149 private: 161 private:
150 static Persistent<Context> utility_context_; 162 static Persistent<Context> utility_context_;
151 static Persistent<Context> evaluation_context_; 163 static Persistent<Context> evaluation_context_;
152 static CounterMap* counter_map_; 164 static CounterMap* counter_map_;
153 // We statically allocate a set of local counters to be used if we 165 // We statically allocate a set of local counters to be used if we
(...skipping 22 matching lines...) Expand all
176 const char* name_; 188 const char* name_;
177 LineEditor* next_; 189 LineEditor* next_;
178 static LineEditor* first_; 190 static LineEditor* first_;
179 }; 191 };
180 192
181 193
182 } // namespace v8 194 } // namespace v8
183 195
184 196
185 #endif // V8_D8_H_ 197 #endif // V8_D8_H_
OLDNEW
« 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