if (op == null) { op = getPrototype("hopobject"); protoname = "hopobject"; }
op = getValidPrototype(protoname);
    public Scriptable getNodeWrapper(INode n) {        // FIXME: is this needed? should this return ESNull.theNull?        if (n == null) {            return null;        }        HopObject esn = (HopObject) wrappercache.get(n);        if (esn == null) {            try {                String protoname = n.getPrototype();                Scriptable op = null;                // set the DbMapping of the node according to its prototype.                // this *should* be done on the objectmodel level, but isn't currently                // for embedded nodes since there's not enough type info at the objectmodel level                // for those nodes.                if ((protoname != null) && (protoname.length() > 0) &&                        (n.getDbMapping() == null)) {                    n.setDbMapping(app.getDbMapping(protoname));                }                op = getPrototype(protoname);                // no prototype found for this node?                if (op == null) {                    op = getPrototype("hopobject");                    protoname = "hopobject";                }                esn = new HopObject(protoname);                esn.init(this, n);                esn.setPrototype(op);                wrappercache.put(n, esn);                // app.logEvent ("Wrapper for "+n+" created");            } catch (Exception x) {                System.err.println("Error creating node wrapper: " + x);                throw new RuntimeException(x.toString());            }        }        return esn;    }