Skip to content

Commit

Permalink
Removed obsolete IOException
Browse files Browse the repository at this point in the history
  • Loading branch information
rPraml authored and gbrail committed Oct 3, 2024
1 parent 6ca1873 commit 3d7b17b
Showing 1 changed file with 22 additions and 35 deletions.
57 changes: 22 additions & 35 deletions rhino/src/main/java/org/mozilla/javascript/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -1414,21 +1414,16 @@ final Script compileString(
String sourceName,
int lineno,
Object securityDomain) {
try {
return (Script)
compileImpl(
null,
source,
sourceName,
lineno,
securityDomain,
false,
compiler,
compilationErrorReporter);
} catch (IOException ioe) {
// Should not happen when dealing with source as string
throw new RuntimeException(ioe);
}
return (Script)
compileImpl(
null,
source,
sourceName,
lineno,
securityDomain,
false,
compiler,
compilationErrorReporter);
}

/**
Expand Down Expand Up @@ -1460,22 +1455,16 @@ final Function compileFunction(
String sourceName,
int lineno,
Object securityDomain) {
try {
return (Function)
compileImpl(
scope,
source,
sourceName,
lineno,
securityDomain,
true,
compiler,
compilationErrorReporter);
} catch (IOException ioe) {
// Should never happen because we just made the reader
// from a String
throw new RuntimeException(ioe);
}
return (Function)
compileImpl(
scope,
source,
sourceName,
lineno,
securityDomain,
true,
compiler,
compilationErrorReporter);
}

/**
Expand Down Expand Up @@ -2434,8 +2423,7 @@ protected Object compileImpl(
Object securityDomain,
boolean returnFunction,
Evaluator compiler,
ErrorReporter compilationErrorReporter)
throws IOException {
ErrorReporter compilationErrorReporter) {
if (sourceName == null) {
sourceName = "unnamed script";
}
Expand Down Expand Up @@ -2513,8 +2501,7 @@ private ScriptNode parse(
int lineno,
CompilerEnvirons compilerEnv,
ErrorReporter compilationErrorReporter,
boolean returnFunction)
throws IOException {
boolean returnFunction) {
Parser p = new Parser(compilerEnv, compilationErrorReporter);
if (returnFunction) {
p.calledByCompileFunction = true;
Expand Down

0 comments on commit 3d7b17b

Please sign in to comment.