This isn't a duplicate of #7352 which can easily be verified by checking this reduced test case which still shows the described behavior and wasn't fixed by the fix for #7352.
But I'm not sure this is even a bug.
wrap as most (all?) other jQuery DOM-manipulation-methods internally does the same cleaning/processing of elements before they are inserted into the DOM. And one of the things jQuery does is, it pulls out any
script elements about to be inserted and executes them and then removes them from the DOM. Taking my reduced test case
DOM before call to
DOM after the call to wrap
If I recall correctly one of the reasons jQuery does this is to avoid "Permission Denied" errors that can occur in Internet Explorer when inserting scripts under certain circumstances.
test case which shows difference between jQuery and pure js approach.
So maybe the real complaint should be that jQuery re-executes script tags that where already executed by the browser. And additionally the script tags just vanish unlike when doing the wrap operation manually in pure js.