Do not catch Exceptions when wrapping globals in enterContext() - this makes
us ignore syntax errors in scripts, prevents useful error messages to be displayed and causes functions to be called in illegal state.
This commit is contained in:
parent
c3af34272f
commit
bc85445744
1 changed files with 9 additions and 13 deletions
|
@ -190,20 +190,16 @@ public class RhinoEngine implements ScriptingEngine {
|
|||
Object v = globals.get(k);
|
||||
Scriptable scriptable = null;
|
||||
|
||||
try {
|
||||
// create a special wrapper for the path object.
|
||||
// other objects are wrapped in the default way.
|
||||
if (v instanceof RequestPath) {
|
||||
scriptable = new PathWrapper((RequestPath) v, core);
|
||||
scriptable.setPrototype(core.pathProto);
|
||||
} else {
|
||||
scriptable = Context.toObject(v, global);
|
||||
}
|
||||
|
||||
global.put(k, global, scriptable);
|
||||
} catch (Exception x) {
|
||||
app.logEvent("Error setting global variable " + k + ": " + x);
|
||||
// create a special wrapper for the path object.
|
||||
// other objects are wrapped in the default way.
|
||||
if (v instanceof RequestPath) {
|
||||
scriptable = new PathWrapper((RequestPath) v, core);
|
||||
scriptable.setPrototype(core.pathProto);
|
||||
} else {
|
||||
scriptable = Context.toObject(v, global);
|
||||
}
|
||||
|
||||
global.put(k, global, scriptable);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue