} else {
Box newnode = (Box)value;
+
+ // check if box being moved is currently target of a redirect
+ for(Box cur = newnode.getParent(); cur != null; cur = cur.getParent())
+ if (cur.redirect == newnode) {
+ if (Log.on) Log.log(this, "attempt to move a box that is the target of a redirect at "+
+ Context.enter().interpreterSourceFile + ":" + Context.enter().interpreterLine);
+ return;
+ }
+
+ // check for recursive ancestor violation
for(Box cur = this; cur != null; cur = cur.getParent())
if (cur == newnode) {
if (Log.on) Log.log(this, "attempt to make a node a parent of its own ancestor at " +