{"action":"created","issue":{"url":"https://api.github.com/repos/processing-js/processing-js/issues/198","labels_url":"https://api.github.com/repos/processing-js/processing-js/issues/198/labels{/name}","comments_url":"https://api.github.com/repos/processing-js/processing-js/issues/198/comments","events_url":"https://api.github.com/repos/processing-js/processing-js/issues/198/events","html_url":"https://github.com/processing-js/processing-js/issues/198","id":101087131,"number":198,"title":"PVector.add() should throw an exception when called with invalid arguments","user":{"login":"teo1978","id":542107,"avatar_url":"https://avatars.githubusercontent.com/u/542107?v=3","gravatar_id":"","url":"https://api.github.com/users/teo1978","html_url":"https://github.com/teo1978","followers_url":"https://api.github.com/users/teo1978/followers","following_url":"https://api.github.com/users/teo1978/following{/other_user}","gists_url":"https://api.github.com/users/teo1978/gists{/gist_id}","starred_url":"https://api.github.com/users/teo1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teo1978/subscriptions","organizations_url":"https://api.github.com/users/teo1978/orgs","repos_url":"https://api.github.com/users/teo1978/repos","events_url":"https://api.github.com/users/teo1978/events{/privacy}","received_events_url":"https://api.github.com/users/teo1978/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/processing-js/processing-js/labels/enhancement","name":"enhancement","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-14T19:29:57Z","updated_at":"2015-08-14T23:13:22Z","closed_at":null,"body":"\r\n    PVector v=new PVector(100, 100);\r\n    v.add(10);\r\n    println(v.x+\" \"+v.y);\r\n\r\nExpected output: an exception\r\nObserved output: Nan Nan\r\n\r\nProcessing issues a compile error in this case. I know PJS cannot issue compile errors, but the least it can do is to throw an exception if a method is called with (easily detectable) invalid arguments.\r\nIt's the most similar thing to Processing's issuing a compile error. One may not run into the error in PJS, but if one does, at least one can debug it."},"comment":{"url":"https://api.github.com/repos/processing-js/processing-js/issues/comments/131265504","html_url":"https://github.com/processing-js/processing-js/issues/198#issuecomment-131265504","issue_url":"https://api.github.com/repos/processing-js/processing-js/issues/198","id":131265504,"user":{"login":"GoToLoop","id":6551569,"avatar_url":"https://avatars.githubusercontent.com/u/6551569?v=3","gravatar_id":"","url":"https://api.github.com/users/GoToLoop","html_url":"https://github.com/GoToLoop","followers_url":"https://api.github.com/users/GoToLoop/followers","following_url":"https://api.github.com/users/GoToLoop/following{/other_user}","gists_url":"https://api.github.com/users/GoToLoop/gists{/gist_id}","starred_url":"https://api.github.com/users/GoToLoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoToLoop/subscriptions","organizations_url":"https://api.github.com/users/GoToLoop/orgs","repos_url":"https://api.github.com/users/GoToLoop/repos","events_url":"https://api.github.com/users/GoToLoop/events{/privacy}","received_events_url":"https://api.github.com/users/GoToLoop/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T23:13:22Z","updated_at":"2015-08-14T23:13:22Z","body":"* In JS, arrays are also objects but w/ positive numerical properties plus a _length_ property.\r\n* A _**PVector**_ instance is merely an object w/ 3 properties: _x_, _y_ & _z_.\r\n* I fail to see why the latter would be \"extremely\" slower than the former!\r\n* When we use _**PVector**_ class we're mostly interested in its methods.\r\n* Otherwise we'd go w/ an `Array(3)` or simply use 3 variables.  O_o"}}