Throw IllegalArgumentException from compileString/compileReader if script line number is negative instead of catching it much later via Context.codeBug().
git-svn-id: svn://10.0.0.236/trunk@144650 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -897,6 +897,10 @@ public class Context {
|
||||
int lineno, Object securityDomain)
|
||||
throws IOException
|
||||
{
|
||||
if (lineno < 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"Line number can not be negative:"+lineno);
|
||||
}
|
||||
return (Script) compile(scope, in, null, sourceName, lineno,
|
||||
securityDomain, false);
|
||||
}
|
||||
@@ -923,6 +927,10 @@ public class Context {
|
||||
String sourceName, int lineno,
|
||||
Object securityDomain)
|
||||
{
|
||||
if (lineno < 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"Line number can not be negative:"+lineno);
|
||||
}
|
||||
try {
|
||||
return (Script) compile(scope, null, source, sourceName, lineno,
|
||||
securityDomain, false);
|
||||
|
||||
Reference in New Issue
Block a user