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

Issue 10252: * Added d8 flag "--" (alias "--js-arguments"). (Closed)

Created:
12 years, 1 month ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Flag passes rest of command line to the shell/scripts being run. Arguments on the command line are made available as a global "arguments" array.

Patch Set 1 #

Patch Set 2 : Addressed reviews, added tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+176 lines, -6 lines) Patch
M src/d8.cc View 1 1 chunk +13 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 2 chunks +19 lines, -0 lines 0 comments Download
M src/flags.h View 3 chunks +3 lines, -1 line 0 comments Download
M src/flags.cc View 1 12 chunks +77 lines, -5 lines 0 comments Download
M test/cctest/test-flags.cc View 1 chunk +64 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Lasse Reichstein
12 years, 1 month ago (2008-11-10 13:26:33 UTC) #1
Christian Plesner Hansen
12 years, 1 month ago (2008-11-10 13:43:08 UTC) #2
Lgtm, with comments.

http://codereview.chromium.org/10252/diff/1/2
File src/d8.cc (right):

http://codereview.chromium.org/10252/diff/1/2#newcode239
Line 239: if (js_args.argc() > 0) {
We should consider defining this always, even when no arguments are given, to
support the standard method of reading (optional) arguments more
straightforwardly.

var first = arguments[0] || (default value)

http://codereview.chromium.org/10252/diff/1/3
File src/flag-definitions.h (right):

http://codereview.chromium.org/10252/diff/1/3#newcode74
Line 74: struct JSArguments {
I wonder if we can find a more general name for this, since it's a general
mechanism that we happen to use for script arguments.

Powered by Google App Engine
This is Rietveld 408576698