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:
igor%mir2.org
2003-07-09 19:27:46 +00:00
parent fc9da21d98
commit eeafbe31a6

View File

@@ -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);