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

Unified Diff: src/api.cc

Issue 99254: Add the "arguments" global to the shell sample. The "arguments"... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/shell.cc ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
===================================================================
--- src/api.cc (revision 1828)
+++ src/api.cc (working copy)
@@ -261,6 +261,19 @@
i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags);
}
+Local<Array> V8::GetJSArguments() {
+ i::JSArguments js_args = i::FLAG_js_arguments;
+ i::Handle<i::FixedArray> arguments_array =
+ i::Factory::NewFixedArray(js_args.argc());
+ for (int j = 0; j < js_args.argc(); j++) {
+ i::Handle<i::String> arg =
+ i::Factory::NewStringFromUtf8(i::CStrVector(js_args[j]));
+ arguments_array->set(j, *arg);
+ }
+ i::Handle<i::JSArray> arguments_jsarray =
+ i::Factory::NewJSArrayWithElements(arguments_array);
+ return Utils::ToLocal(arguments_jsarray);
+}
v8::Handle<Value> ThrowException(v8::Handle<v8::Value> value) {
if (IsDeadCheck("v8::ThrowException()")) return v8::Handle<Value>();
« no previous file with comments | « samples/shell.cc ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698