{"action":"created","issue":{"url":"https://api.github.com/repos/FungusHumungus/pongular/issues/20","labels_url":"https://api.github.com/repos/FungusHumungus/pongular/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/FungusHumungus/pongular/issues/20/comments","events_url":"https://api.github.com/repos/FungusHumungus/pongular/issues/20/events","html_url":"https://github.com/FungusHumungus/pongular/pull/20","id":58288643,"number":20,"title":"fix HashMap so it no longer hashes all functions using their source stri...","user":{"login":"jurko-gospodnetic","id":3112833,"avatar_url":"https://avatars.githubusercontent.com/u/3112833?v=3","gravatar_id":"","url":"https://api.github.com/users/jurko-gospodnetic","html_url":"https://github.com/jurko-gospodnetic","followers_url":"https://api.github.com/users/jurko-gospodnetic/followers","following_url":"https://api.github.com/users/jurko-gospodnetic/following{/other_user}","gists_url":"https://api.github.com/users/jurko-gospodnetic/gists{/gist_id}","starred_url":"https://api.github.com/users/jurko-gospodnetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jurko-gospodnetic/subscriptions","organizations_url":"https://api.github.com/users/jurko-gospodnetic/orgs","repos_url":"https://api.github.com/users/jurko-gospodnetic/repos","events_url":"https://api.github.com/users/jurko-gospodnetic/events{/privacy}","received_events_url":"https://api.github.com/users/jurko-gospodnetic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-19T23:37:22Z","updated_at":"2015-02-19T23:39:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/FungusHumungus/pongular/pulls/20","html_url":"https://github.com/FungusHumungus/pongular/pull/20","diff_url":"https://github.com/FungusHumungus/pongular/pull/20.diff","patch_url":"https://github.com/FungusHumungus/pongular/pull/20.patch"},"body":"This was causing different function instances created from the same source code\r\n(e.g. as local functions inside the same function) to be hashed the same.\r\n\r\nOne of the effects was that when using `mocks.module()` and passing it an object\r\nlike so:\r\n```javascript\r\n  mocks.module({myService: 42});\r\n```\r\nworked if it was the first such `mocks.module()` call for a single test. Any later\r\nlater such calls (whether passing them same or different object) were simply\r\nignored by the constructed mocks injector. This is so because all such passed\r\nobjects are actually represented as functions in an internal pongular module list\r\nand, since they are all constructed using the same source, they are all hashed\r\nthe same so when pongular asks 'do I already have this module loaded?' it thinks\r\nthe answer is yes as it can find that same hash in its `HashMap` of already loaded\r\nmodules.\r\n\r\nMatching workaround has long since been applied in angular sources."},"comment":{"url":"https://api.github.com/repos/FungusHumungus/pongular/issues/comments/75162636","html_url":"https://github.com/FungusHumungus/pongular/pull/20#issuecomment-75162636","issue_url":"https://api.github.com/repos/FungusHumungus/pongular/issues/20","id":75162636,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T23:39:25Z","updated_at":"2015-02-19T23:39:25Z","body":"\n[![Coverage Status](https://coveralls.io/builds/1960463/badge)](https://coveralls.io/builds/1960463)\n\nCoverage increased (+0.56%) to 96.34% when pulling **16c89f307f5a900e3ea28c907b0626c9407d9198 on jurko-gospodnetic:fix-for-multiple-mock-module-calls-with-object** into **f3f6a800afc28103502509abab5f3f27cd14d37f on FungusHumungus:master**.\n"}}