mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-07 03:45:42 +00:00
Propagate fix to 41872 from the standalone JS shell to the standalone XPConnect-enabled JS shell. Make warnings on by default in the standalone JS shell, and introduce the -W option to suppress warnings if needed. Retained the -w option (enable warnings) in case somebody was using it.
This file doesn't go into the Mozilla distribution. r=brendan,r=jband
This commit is contained in:
parent
efcc4dca6c
commit
465dd07c7a
@ -99,7 +99,7 @@ FILE *gErrFile = NULL;
|
|||||||
|
|
||||||
int gExitCode = 0;
|
int gExitCode = 0;
|
||||||
JSBool gQuitting = JS_FALSE;
|
JSBool gQuitting = JS_FALSE;
|
||||||
static int reportWarnings = 0;
|
static JSBool reportWarnings = JS_TRUE;
|
||||||
|
|
||||||
static void PR_CALLBACK
|
static void PR_CALLBACK
|
||||||
my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
|
my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
|
||||||
@ -548,7 +548,7 @@ static int
|
|||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
fprintf(gErrFile, "%s\n", JS_GetImplementationVersion());
|
fprintf(gErrFile, "%s\n", JS_GetImplementationVersion());
|
||||||
fprintf(gErrFile, "usage: xpcshell [-s] [-w] [-v version] [-f scriptfile] [scriptfile] [scriptarg...]\n");
|
fprintf(gErrFile, "usage: xpcshell [-s] [-w] [-W] [-v version] [-f scriptfile] [scriptfile] [scriptarg...]\n");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,8 +573,11 @@ ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc)
|
|||||||
JS_SetVersion(cx, JSVersion(atoi(argv[i+1])));
|
JS_SetVersion(cx, JSVersion(atoi(argv[i+1])));
|
||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
|
case 'W':
|
||||||
|
reportWarnings = JS_FALSE;
|
||||||
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
reportWarnings++;
|
reportWarnings = JS_TRUE;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
JS_ToggleOptions(cx, JSOPTION_STRICT);
|
JS_ToggleOptions(cx, JSOPTION_STRICT);
|
||||||
|
Loading…
Reference in New Issue
Block a user