I think Bob is the best person to answer this, but in the current
version of the code "MochiKit.DOM", "MochiKit.Style" and friends are
all created by the MochiKit.Base._module function. This function
automatically inserts a few practical helpers, such as the module
name, __repr__() and toString(). So by using a call to update(), these
generated helper properties are kept intact.
An alternative would of course be to assign each property by itself:
MochiKit.DOM.currentWindow = ...
MochiKit.DOM.currentDocument = ...
But I think people would consider this too verbose. I don't mind
myself though, because I think it would increase the code clarity
somewhat.
Anyway. The "correct" way of doing a library nowadays I think is this:
(function(scope) {
... declare stuff ...
... export selected resources into 'scope.MochiKit.DOM' ...
})(this);
That would hide internal methods securely inside an inner scope. But
sometimes the internal methods are quite handy of course...
Cheers,
/Per