Chromium Code Reviews
DescriptionAdd the "arguments" global to the shell sample.
The "arguments" global is commonly used by Javascript shells to pass command line arguments to
the Javascript script. Rhino does this, as does v8's own "d8" shell.
This change works by adding a new public API to v8, GetJSAttributes(), which
returns a Javascript array of the arguments. While it might seem scary to add a
new API, this API is already implicit in the way that arguments are parsed by
the existing SetFlagsFromString and SetFlagsFromCommandLine APIs. Those APIs
already recognize the "--" flag and saves away any arguments after the "--"
flag. All this change does is prove a way of getting
at the saved arguments.
The implementation of GetJSAttributes() was extracted from the d8 shell.
Patch Set 1 #
Messages
Total messages: 2 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||