зеркало из https://github.com/mozilla/pjs.git
Add -debug flag to shell. Will cause it to generate debug for compiled class
files.
This commit is contained in:
Родитель
3834e6fd31
Коммит
40afa4fbf1
|
@ -59,7 +59,8 @@ msg.shell.usage =\
|
|||
\ -version 100|110|120|130|140|150|160\n\
|
||||
\ -opt [-1|0-9]\n\
|
||||
\ -f script-filename\n\
|
||||
\ -e script-source
|
||||
\ -e script-source\n\
|
||||
\ -debug
|
||||
|
||||
|
||||
msg.help =\
|
||||
|
|
|
@ -280,6 +280,10 @@ public class Main
|
|||
global.setSealedStdLib(true);
|
||||
continue;
|
||||
}
|
||||
if (arg.equals("-debug")) {
|
||||
shellContextFactory.setGeneratingDebug(true);
|
||||
continue;
|
||||
}
|
||||
usageError = arg;
|
||||
break goodUsage;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public class ShellContextFactory extends ContextFactory
|
|||
private boolean strictMode;
|
||||
private int languageVersion;
|
||||
private int optimizationLevel;
|
||||
private boolean generatingDebug;
|
||||
private ErrorReporter errorReporter;
|
||||
|
||||
protected boolean hasFeature(Context cx, int featureIndex)
|
||||
|
@ -64,6 +65,7 @@ public class ShellContextFactory extends ContextFactory
|
|||
if (errorReporter != null) {
|
||||
cx.setErrorReporter(errorReporter);
|
||||
}
|
||||
cx.setGeneratingDebug(generatingDebug);
|
||||
super.onContextCreated(cx);
|
||||
}
|
||||
|
||||
|
@ -93,4 +95,8 @@ public class ShellContextFactory extends ContextFactory
|
|||
this.errorReporter = errorReporter;
|
||||
}
|
||||
|
||||
public void setGeneratingDebug(boolean generatingDebug)
|
||||
{
|
||||
this.generatingDebug = generatingDebug;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче