{"action":"created","issue":{"url":"https://api.github.com/repos/danShumway/vAnalyze.js/issues/14","labels_url":"https://api.github.com/repos/danShumway/vAnalyze.js/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/danShumway/vAnalyze.js/issues/14/comments","events_url":"https://api.github.com/repos/danShumway/vAnalyze.js/issues/14/events","html_url":"https://github.com/danShumway/vAnalyze.js/issues/14","id":69483692,"number":14,"title":"Infect boxes primitive types on sub-properties","user":{"login":"danShumway","id":3317194,"avatar_url":"https://avatars.githubusercontent.com/u/3317194?v=3","gravatar_id":"","url":"https://api.github.com/users/danShumway","html_url":"https://github.com/danShumway","followers_url":"https://api.github.com/users/danShumway/followers","following_url":"https://api.github.com/users/danShumway/following{/other_user}","gists_url":"https://api.github.com/users/danShumway/gists{/gist_id}","starred_url":"https://api.github.com/users/danShumway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danShumway/subscriptions","organizations_url":"https://api.github.com/users/danShumway/orgs","repos_url":"https://api.github.com/users/danShumway/repos","events_url":"https://api.github.com/users/danShumway/events{/privacy}","received_events_url":"https://api.github.com/users/danShumway/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/danShumway/vAnalyze.js/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/danShumway/vAnalyze.js/milestones/3","html_url":"https://github.com/danShumway/vAnalyze.js/milestones/base%20functionality","labels_url":"https://api.github.com/repos/danShumway/vAnalyze.js/milestones/3/labels","id":1057507,"number":3,"title":"base functionality","description":"vAnalyze.js should be usable in controlled settings and personally owned codebases.","creator":{"login":"danShumway","id":3317194,"avatar_url":"https://avatars.githubusercontent.com/u/3317194?v=3","gravatar_id":"","url":"https://api.github.com/users/danShumway","html_url":"https://github.com/danShumway","followers_url":"https://api.github.com/users/danShumway/followers","following_url":"https://api.github.com/users/danShumway/following{/other_user}","gists_url":"https://api.github.com/users/danShumway/gists{/gist_id}","starred_url":"https://api.github.com/users/danShumway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danShumway/subscriptions","organizations_url":"https://api.github.com/users/danShumway/orgs","repos_url":"https://api.github.com/users/danShumway/repos","events_url":"https://api.github.com/users/danShumway/events{/privacy}","received_events_url":"https://api.github.com/users/danShumway/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2015-04-08T03:16:23Z","updated_at":"2015-04-20T01:08:33Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-04-20T01:08:33Z","updated_at":"2015-04-28T03:12:40Z","closed_at":null,"body":"```javascript\r\nvar obj = { x: 5 };\r\nconsole.log(obj.x); //5\r\nobj.infect();\r\nconsole.log(obj.x); //Number {[[PrimitiveValue]]: 5}\r\n```\r\n\r\nPretty critical that this get fixed. "},"comment":{"url":"https://api.github.com/repos/danShumway/vAnalyze.js/issues/comments/96894474","html_url":"https://github.com/danShumway/vAnalyze.js/issues/14#issuecomment-96894474","issue_url":"https://api.github.com/repos/danShumway/vAnalyze.js/issues/14","id":96894474,"user":{"login":"danShumway","id":3317194,"avatar_url":"https://avatars.githubusercontent.com/u/3317194?v=3","gravatar_id":"","url":"https://api.github.com/users/danShumway","html_url":"https://github.com/danShumway","followers_url":"https://api.github.com/users/danShumway/followers","following_url":"https://api.github.com/users/danShumway/following{/other_user}","gists_url":"https://api.github.com/users/danShumway/gists{/gist_id}","starred_url":"https://api.github.com/users/danShumway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danShumway/subscriptions","organizations_url":"https://api.github.com/users/danShumway/orgs","repos_url":"https://api.github.com/users/danShumway/repos","events_url":"https://api.github.com/users/danShumway/events{/privacy}","received_events_url":"https://api.github.com/users/danShumway/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T03:12:40Z","updated_at":"2015-04-28T03:12:40Z","body":"Done a lot of research on this problem.  It's not easy to solve.  Well, it is, it's just not easy to solve if people want to still be able to wrap primitive types and have vAnalyze catch on to that as well.\r\n\r\nAs part of my recently developing philosophy (for vAnalyze in specific) of works well for most things is better than perfect, I think making some assumptions that wrapped types are actually primitives is the right idea.  That's how they'll be used most of the time.\r\n\r\nLikely there should be some kind of option for this that the user can toggle on and off.  How to handle mixes (ie, half of these are primitive and half of them aren't) is also doable, but not on the top of my priority list right now.  But I've been running infections on stuff like jQuery, and it doesn't fail when I make that assumption, so I think it's fine, at least for now.\r\n\r\nLots of other things jQuery does do that seem insane to me, but whatever.  This is the least of problems weird programs will have.\r\n\r\nThis is the thing I've been figuring out through usage - everybody does something weird with their programs.  Generous application of try-catch loops genuinely feels like good practice here.  vAnalyze should try and infect the things it can, and handle failures gracefully.\r\n\r\nIt's a tool for knocking down houses, not a tool for building them, and as such, I'd rather have  feature that's customizable and flexible and mostly works, than not have a feature because it's not perfect."}}