Committing patch from Rashid to call postCompile() function if it is defined

after a prototype has been evaluated.
This commit is contained in:
hns 2004-06-28 16:56:17 +00:00
parent e1139be0ff
commit 2a24c4f8aa

View file

@ -258,6 +258,17 @@ public final class RhinoCore {
type.compiledFunctions = newFunctions;
type.lastUpdate = prototype.getLastUpdate();
// If this prototype defines a postCompile() function, call it
Context cx = Context.getCurrentContext();
try {
Object fObj = op.get("postCompile",op);
if (fObj instanceof Function) {
((Function) fObj).call(cx, global, op, new Object[0]);
}
} catch (Exception x) {
app.logError("Exception in "+prototype.getName()+".postCompile(): " + x, x);
}
}
/**