jquery/jquery — pull request #1276 by orkel (2013-05-24 09:41:24+00:00)
Title: Simplification of replaceWith method

Not for 1.10.0 or 2.0.1.
It's smaller:

raw gz Compared to master @ 997da31121b9d084ccba05a9bb1e258c8c8faaf0
-440 -141 dist/jquery.js
-78 -37 dist/jquery.min.js

and faster: http://jsperf.com/simplified-replacewith

Although this code (as code in master) fails with self-replacement cases. But i suppose these are very edge stuff giving that jQuery lived with them since the beginning.

/cc @gibson042