> If jQuery were to try and track circular references it would: > A) Make .extends extremely inefficient because it would have to store > just about everything it touches and make sure it doesn't recurse > B) No longer create duplicate objects as it was told to
For B), it would create duplicates objects as it wouldn't be the same objects as source, but it would conserve cycles inside an object graph. It don't think it causes a semantical problem, as when you copy a graph, it would be normal to copy relations between nodes too. For A), this is another problem. Yes, it could reduce performances as we would have to create a mapping object and we would have to test and add every object on it. But, - after all, it is only a condition to add if( typeof mapping[ copy ] != 'undefined' ) { target[ name ] = mapping[ copy ]; } where copy would be the object inside a cycle. In fact, it is a bit more complex, but not more costly - When I see the complexity of some functions to have exactly the exact rendering we want, I don't understand why it causes a problem to add one or two conditions and store temporarily data. Ludovic --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---