{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/895","labels_url":"https://api.github.com/repos/lodash/lodash/issues/895/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/895/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/895/events","html_url":"https://github.com/lodash/lodash/issues/895","id":55753203,"number":895,"title":"_.merge() ends up to DOMException when \"sources\" contains Element object(s)","user":{"login":"Jesus-21","id":8310941,"avatar_url":"https://avatars.githubusercontent.com/u/8310941?v=3","gravatar_id":"","url":"https://api.github.com/users/Jesus-21","html_url":"https://github.com/Jesus-21","followers_url":"https://api.github.com/users/Jesus-21/followers","following_url":"https://api.github.com/users/Jesus-21/following{/other_user}","gists_url":"https://api.github.com/users/Jesus-21/gists{/gist_id}","starred_url":"https://api.github.com/users/Jesus-21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jesus-21/subscriptions","organizations_url":"https://api.github.com/users/Jesus-21/orgs","repos_url":"https://api.github.com/users/Jesus-21/repos","events_url":"https://api.github.com/users/Jesus-21/events{/privacy}","received_events_url":"https://api.github.com/users/Jesus-21/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lodash/lodash/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-28T12:59:40Z","updated_at":"2015-01-28T21:18:07Z","closed_at":"2015-01-28T21:17:55Z","body":"Hi,\r\nI was trying to update to version 3.0.0 but I had unfortunate experience due to this upgrade.\r\nIf I try to merge objects that contain Element, I end up with the following error:\r\n```\r\nDOMException: Failed to set the 'outerHTML' property on 'Element': This element has no parent node.\r\n```\r\n\r\nAs far as I understand, it happens at the very last step of baseMerge, object[key] = result;\r\n\r\nFor a better understanding, here is a simple example:\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n  <meta charset=\"utf-8\"/>\r\n</head>\r\n<body>\r\n<div id=\"foo\">FOO</div>\r\n<div id=\"bar\">BAR</div>\r\n<script src=\"lodash-3.0.0.js\"></script>\r\n<!-- <script src=\"lodash-2.4.1.js\"></script> -->\r\n<script>\r\n  var a = {el: document.getElementById(\"foo\")};\r\n  var b = {el: document.getElementById(\"bar\")};\r\n\r\n  var c;\r\n  try {\r\n    c = _.merge({el: null}, b); // FAIL\r\n    console.log(c);\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n\r\n  try {\r\n    c = _.merge(a, b); // FAIL\r\n    console.log(c);\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n\r\n  try {\r\n    c = _.merge(a, {el: null}); // Object {el: null}\r\n    console.log(c);\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n</script>\r\n</body>\r\n</html>\r\n```\r\n\r\nSo it works, unless the *sources* (var b) contains an Element.\r\nIt is IMPORTANT to note that _.merge() of such objects worked on 2.4.1 version of lodash.\r\n\r\nIs it a misuse of the merge function on my hand or is this a regression?\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/71917984","html_url":"https://github.com/lodash/lodash/issues/895#issuecomment-71917984","issue_url":"https://api.github.com/repos/lodash/lodash/issues/895","id":71917984,"user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T21:18:07Z","updated_at":"2015-01-28T21:18:07Z","body":"I'll post tests tonight."}}