{"action":"created","issue":{"url":"https://api.github.com/repos/madrobby/zepto/issues/549","labels_url":"https://api.github.com/repos/madrobby/zepto/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/madrobby/zepto/issues/549/comments","events_url":"https://api.github.com/repos/madrobby/zepto/issues/549/events","html_url":"https://github.com/madrobby/zepto/pull/549","id":5643957,"number":549,"title":"Ensure array's native filter()","user":{"login":"johnboxall","id":28967,"avatar_url":"https://avatars.githubusercontent.com/u/28967?v=3","gravatar_id":"","url":"https://api.github.com/users/johnboxall","html_url":"https://github.com/johnboxall","followers_url":"https://api.github.com/users/johnboxall/followers","following_url":"https://api.github.com/users/johnboxall/following{/other_user}","gists_url":"https://api.github.com/users/johnboxall/gists{/gist_id}","starred_url":"https://api.github.com/users/johnboxall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnboxall/subscriptions","organizations_url":"https://api.github.com/users/johnboxall/orgs","repos_url":"https://api.github.com/users/johnboxall/repos","events_url":"https://api.github.com/users/johnboxall/events{/privacy}","received_events_url":"https://api.github.com/users/johnboxall/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2012-07-16T16:50:43Z","updated_at":"2015-06-15T12:26:32Z","closed_at":"2012-09-29T12:33:59Z","pull_request":{"url":"https://api.github.com/repos/madrobby/zepto/pulls/549","html_url":"https://github.com/madrobby/zepto/pull/549","diff_url":"https://github.com/madrobby/zepto/pull/549.diff","patch_url":"https://github.com/madrobby/zepto/pull/549.patch"},"body":"Including Prototype.js 1.7 on the same page as Zepto can lead to erratic behaviour:\n\nhttp://mobifydevtest.s3.amazonaws.com/test/zepto-prototype-filter/index.html\n\nThis change resolves that particular issue by ensuring save a reference to the native filter as soon as Zepto is loaded."},"comment":{"url":"https://api.github.com/repos/madrobby/zepto/issues/comments/112043570","html_url":"https://github.com/madrobby/zepto/pull/549#issuecomment-112043570","issue_url":"https://api.github.com/repos/madrobby/zepto/issues/549","id":112043570,"user":{"login":"kusmierz","id":404344,"avatar_url":"https://avatars.githubusercontent.com/u/404344?v=3","gravatar_id":"","url":"https://api.github.com/users/kusmierz","html_url":"https://github.com/kusmierz","followers_url":"https://api.github.com/users/kusmierz/followers","following_url":"https://api.github.com/users/kusmierz/following{/other_user}","gists_url":"https://api.github.com/users/kusmierz/gists{/gist_id}","starred_url":"https://api.github.com/users/kusmierz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kusmierz/subscriptions","organizations_url":"https://api.github.com/users/kusmierz/orgs","repos_url":"https://api.github.com/users/kusmierz/repos","events_url":"https://api.github.com/users/kusmierz/events{/privacy}","received_events_url":"https://api.github.com/users/kusmierz/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T12:26:32Z","updated_at":"2015-06-15T12:26:32Z","body":"Prototype-like frameworks change natives methods (I know, it's really bad), but we have to deal with it.\r\n\r\nI discovered that we can get \"clear\" version of native array even if it has been changed by another js script.\r\n\r\n```javascript\r\n  var ifrm = window.document.createElement('iframe'),\r\n      bodyOrHead = window.document.body || window.document.head;\r\n\r\n  bodyOrHead.appendChild(ifrm);\r\n  var emptyArrayNative = ifrm.contentWindow.Array.prototype;\r\n\r\n  bodyOrHead.removeChild(ifrm);\r\n```\r\n\r\nNext, we could set `emptyArray` var as `var emptyArray = emptyArrayNative || [];`\r\n\r\nIt should permanently fix conflict problems with any other scripts/frameworks."}}