> > > 'this' would be the object, not window when callback object is used. >
I was talking about what Ojan wrote: I was specifically talking about WebIDL Dictionaries. In which case, this.undo would set the undo property on the window. Why would you want to be able to set the undo function from the execut function? My whole point has been that we should not keep the actual object. on which, by the way, I also have to say: one of the nice things about the web is that the most interesting things sprout out of things being used out of context and beyond their purpose (am I quoting Einstein when I say that "a problem cannot be solved using the same terms that were used to define it"?). In this specific case, access to the object allows for context in the execute() call. This supports the notion, which you may discard of, of a module for actions that is separate from the UndoManager. Re using actions for several times, intuitively, an UndoManager can either throw an exception when an action is performed twice, or --the more elegant approach imo-- let an action be executed multiple times, and whatever would have applied to the single action (undo/redo behaviour) applies to each transaction. And if the author chooses to meddle with the undo/redo behaviour after execution, it's her responsibility. What applies to the operation is what is defined at the time the undo/redo occurs. Keep it simple. Yuval
