Fix for AVATAR_JS-145, added support for --no-deprecation, deprecations are not thrown by default

This commit is contained in:
jfdenise 2014-01-14 10:32:59 +01:00
parent a712a1a3fb
commit 39a25e4286
3 changed files with 18 additions and 5 deletions

View File

@ -347,10 +347,9 @@ public final class Server {
dumpUVVersion = true;
break;
} else if ("--no-deprecation".equals(arg)) {
holder.setThrowDeprecation(false);
holder.setNoDeprecation(true);
} else if ("--trace-deprecation".equals(arg)) {
holder.setTraceDeprecation(true);
holder.setThrowDeprecation(false);
} else if ("--throw-deprecation".equals(arg)) {
holder.setThrowDeprecation(true);
} else if ("-i".equals(arg) || "--interactive".equals(arg)) {
@ -444,8 +443,9 @@ public final class Server {
private String[] userArgs;
private String[] userFiles;
private String evalString;
private boolean throwDeprecation = true;
private boolean throwDeprecation;
private boolean traceDeprecation;
private boolean noDeprecation;
private boolean forceRepl = false;
private boolean printEval = false;
private int exitCode = 0;
@ -503,6 +503,10 @@ public final class Server {
this.traceDeprecation = traceDeprecation;
}
private void setNoDeprecation(boolean noDeprecation) {
this.noDeprecation = noDeprecation;
}
private void setForceRepl(boolean forceRepl) {
this.forceRepl = forceRepl;
}
@ -519,6 +523,10 @@ public final class Server {
return throwDeprecation;
}
public boolean getNoDeprecation() {
return noDeprecation;
}
public boolean getTraceDeprecation() {
return traceDeprecation;
}

View File

@ -85,6 +85,11 @@ Object.defineProperty(exports, 'traceDeprecation', {
value: __avatar.traceDeprecation
});
Object.defineProperty(exports, 'noDeprecation', {
enumerable: true,
value: __avatar.noDeprecation
});
Object.defineProperty(exports, '_forceRepl', {
enumerable: true,
value: __avatar.forceRepl

View File

@ -157,8 +157,8 @@ var args = ['-server', (assertions ? '-ea' : '-da'), '-Djava.awt.headless=true']
args.push('-Xcheck:jni');
args.push('-Djava.library.path=' + target);
var jarArgs = ['-jar', jar.toString()];
if (!deprecations) {
jarArgs.push('--no-deprecation');
if (deprecations) {
jarArgs.push('--throw-deprecation');
}
if (secure) {
args.push('-Djava.security.manager');