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

Issue 99254: Add the "arguments" global to the shell sample. The "arguments"... (Closed)

Created:
11 years, 7 months ago by jackpal
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -11 lines) Patch
M include/v8.h View 1 chunk +5 lines, -0 lines 0 comments Download
M samples/shell.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/api.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M src/d8.cc View 1 chunk +1 line, -11 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
jackpal
My first patch to v8, please help me correct any mistakes. Mr. Gjesse, I just ...
11 years, 7 months ago (2009-04-30 23:24:39 UTC) #1
Søren Thygesen Gjesse
11 years, 7 months ago (2009-05-04 07:12:51 UTC) #2
The sample shell in the V8 repository is supposed to be just a sample, and
therefore has just the most basic features to illustrate various V8 constructs.

For more advanced shell features the developer shell D8 is supposed to be used,
and is the place for the whatever features are required for an advanced V8 based
JavaScript  shell.

From you comments it looks as if you have already used D8, if there are some
shortcommings in D8 we would rather see these fixed in D8.

Powered by Google App Engine
This is Rietveld 408576698