{"action":"created","issue":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5076","repository_url":"https://api.github.com/repos/Leaflet/Leaflet","labels_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5076/labels{/name}","comments_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5076/comments","events_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5076/events","html_url":"https://github.com/Leaflet/Leaflet/issues/5076","id":187122604,"number":5076,"title":"Strange behaviour on L.Control.Layers<._addLayer","user":{"login":"rburone","id":13885895,"avatar_url":"https://avatars.githubusercontent.com/u/13885895?v=3","gravatar_id":"","url":"https://api.github.com/users/rburone","html_url":"https://github.com/rburone","followers_url":"https://api.github.com/users/rburone/followers","following_url":"https://api.github.com/users/rburone/following{/other_user}","gists_url":"https://api.github.com/users/rburone/gists{/gist_id}","starred_url":"https://api.github.com/users/rburone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rburone/subscriptions","organizations_url":"https://api.github.com/users/rburone/orgs","repos_url":"https://api.github.com/users/rburone/repos","events_url":"https://api.github.com/users/rburone/events{/privacy}","received_events_url":"https://api.github.com/users/rburone/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-03T16:36:32Z","updated_at":"2016-11-22T16:43:55Z","closed_at":"2016-11-04T18:56:36Z","body":"- [x] I'm reporting a bug, not asking for help\r\n- [x] I've looked at the [documentation](http://leafletjs.com/reference-1.0.0.html) to make sure the behaviour is documented and expected\r\n- [x] I'm sure this is a Leaflet code issue, not an issue with my own code nor with the framework I'm using (Cordova, Ionic, Angular, React…)\r\n- [x] I've searched through the issues to make sure it's not yet reported\r\n\r\n----\r\n\r\n## How to reproduce\r\nIf i use a Array.prototype.someThing definitions, the layers dont´work and report the error: \r\n  _Error: layer.on is not a function\r\n  L.Control.Layers<._addLayer@http://localhost/leaflet/lib/leaflet-src.js:12307:4\r\n  L.Control.Layers<.initialize@http://localhost/leaflet/lib/leaflet-src.js:12169:4\r\n  L.Class.extend/NewClass@http://localhost/leaflet/lib/leaflet-src.js:310:4\r\n  L.control.layers@http://localhost/leaflet/lib/leaflet-src.js:12487:9_\r\n\r\n```\r\naddLayer: function (layer, name, overlay) {\r\n\t\tconsole.log(layer); ---> __function Array.prototype.someThing()_;\r\n```\r\nwhen i delete de Array.prototypes definitions. The layers started to work.\r\nI patched putting a condition:\r\n\r\n```\r\n_addLayer: function (layer, name, overlay) {\r\n      if (typeof layer == 'object') {\r\n          ....\r\n      }\r\n```\r\nthen worked.\r\n\r\n- Leaflet version I'm using: 2.0.0\r\n- Browser (with version) I'm using: Firefox and Chrome.\r\n- OS/Platform (with version) I'm using: Windows 8.\r\n\r\nI´m using AngularJS 1.5.5 and the ui-leaflet.js library.\r\n"},"comment":{"url":"https://api.github.com/repos/Leaflet/Leaflet/issues/comments/262294208","html_url":"https://github.com/Leaflet/Leaflet/issues/5076#issuecomment-262294208","issue_url":"https://api.github.com/repos/Leaflet/Leaflet/issues/5076","id":262294208,"user":{"login":"grischard","id":1556567,"avatar_url":"https://avatars.githubusercontent.com/u/1556567?v=3","gravatar_id":"","url":"https://api.github.com/users/grischard","html_url":"https://github.com/grischard","followers_url":"https://api.github.com/users/grischard/followers","following_url":"https://api.github.com/users/grischard/following{/other_user}","gists_url":"https://api.github.com/users/grischard/gists{/gist_id}","starred_url":"https://api.github.com/users/grischard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grischard/subscriptions","organizations_url":"https://api.github.com/users/grischard/orgs","repos_url":"https://api.github.com/users/grischard/repos","events_url":"https://api.github.com/users/grischard/events{/privacy}","received_events_url":"https://api.github.com/users/grischard/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T16:43:55Z","updated_at":"2016-11-22T16:43:55Z","body":"I think I've reproduced it:\r\n\r\nhttps://playground-leaflet.rhcloud.com/kovu/edit?html,console,output"}}
{"actor":{"display_login":"grischard"}}