Last Comment Bug 673612 - JS shell does not show help for profiling functions
: JS shell does not show help for profiling functions
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla8
Assigned To: Steve Fink [:sfink] [:s:]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on: 684713
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-22 16:44 PDT by Steve Fink [:sfink] [:s:]
Modified: 2011-09-07 14:49 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Recover the missing help messages (2.34 KB, patch)
2011-07-22 16:44 PDT, Steve Fink [:sfink] [:s:]
cdleary: review+
Details | Diff | Splinter Review

Description Steve Fink [:sfink] [:s:] 2011-07-22 16:44:27 PDT
Created attachment 547842 [details] [diff] [review]
Recover the missing help messages

help() in the JS shell only prints out the help for the functions defined directly in shell/js.cpp, not all the help messages that are defined.
Comment 1 Chris Leary [:cdleary] (not checking bugmail) 2011-08-01 10:08:00 PDT
Comment on attachment 547842 [details] [diff] [review]
Recover the missing help messages

Review of attachment 547842 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/shell/js.cpp
@@ +5100,5 @@
>  
>      fprintf(gOutFile, "%s\n", JS_GetImplementationVersion());
>      if (argc == 0) {
>          fputs(shell_help_header, gOutFile);
> +        for (i = 0; i < (sizeof(shell_help_messages) / sizeof(shell_help_messages[0])); ++i)

JS_ARRAY_SIZE macro does exactly this, IIRC.

@@ +5123,3 @@
>                      return JS_FALSE;
> +                for (j = 0; j < (sizeof(shell_help_messages) / sizeof(shell_help_messages[0])); ++j)
> +                {

Ditto on the limit, brace on same line?
Comment 2 Steve Fink [:sfink] [:s:] 2011-08-01 16:06:33 PDT
Fixed nits, thanks. (JS_ARRAY_LENGTH, btw.)

http://hg.mozilla.org/integration/mozilla-inbound/rev/97cc7ab517e0
Comment 3 Marco Bonardo [::mak] 2011-08-02 03:22:57 PDT
http://hg.mozilla.org/mozilla-central/rev/97cc7ab517e0

Note You need to log in before you can comment on or make changes to this bug.