diff --git a/src/helma/scripting/rhino/HopObjectCtor.java b/src/helma/scripting/rhino/HopObjectCtor.java index a94f7fd3..de482ec2 100644 --- a/src/helma/scripting/rhino/HopObjectCtor.java +++ b/src/helma/scripting/rhino/HopObjectCtor.java @@ -109,7 +109,7 @@ public class HopObjectCtor extends FunctionObject { } public Object get(String name, Scriptable start) { - if (!initialized && !"prototype".equals(name)) { + if (!initialized && core.isInitialized()) { // trigger prototype compilation on static // constructor property access initialized = true; diff --git a/src/helma/scripting/rhino/RhinoCore.java b/src/helma/scripting/rhino/RhinoCore.java index 1b0aa608..f7b4dbe3 100644 --- a/src/helma/scripting/rhino/RhinoCore.java +++ b/src/helma/scripting/rhino/RhinoCore.java @@ -78,6 +78,7 @@ public final class RhinoCore implements ScopeProvider { // debugger/tracer flags boolean hasDebugger = false; boolean hasTracer = false; + private boolean isInitialized = false; // dynamic portion of the type check sleep that grows // as the app remains unchanged @@ -170,9 +171,14 @@ public final class RhinoCore implements ScopeProvider { throw new RuntimeException(e.getMessage(), e); } finally { contextFactory.exit(); + isInitialized = true; } } + boolean isInitialized() { + return isInitialized; + } + void initDebugger(Context context) { try { if (debugger == null) {