{"action":"opened","number":101,"pull_request":{"url":"https://api.github.com/repos/LLK/scratch-vm/pulls/101","id":81044644,"html_url":"https://github.com/LLK/scratch-vm/pull/101","diff_url":"https://github.com/LLK/scratch-vm/pull/101.diff","patch_url":"https://github.com/LLK/scratch-vm/pull/101.patch","issue_url":"https://api.github.com/repos/LLK/scratch-vm/issues/101","number":101,"state":"open","locked":false,"title":"Filling out operators and fixing up casting to look like Scratch","user":{"login":"tmickel","id":120403,"avatar_url":"https://avatars.githubusercontent.com/u/120403?v=3","gravatar_id":"","url":"https://api.github.com/users/tmickel","html_url":"https://github.com/tmickel","followers_url":"https://api.github.com/users/tmickel/followers","following_url":"https://api.github.com/users/tmickel/following{/other_user}","gists_url":"https://api.github.com/users/tmickel/gists{/gist_id}","starred_url":"https://api.github.com/users/tmickel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmickel/subscriptions","organizations_url":"https://api.github.com/users/tmickel/orgs","repos_url":"https://api.github.com/users/tmickel/repos","events_url":"https://api.github.com/users/tmickel/events{/privacy}","received_events_url":"https://api.github.com/users/tmickel/received_events","type":"User","site_admin":false},"body":"The first commit finishes implementing the remaining operators, including string join, letter of, string length, mod, round, and the math functions.\r\n\r\nThe second commit adds a set of utilities for casting and comparing values the way Scratch does. E.g., it will properly coerce numbers, booleans, and strings to each other, when asked. I modified the operator blocks to use these utility functions, and combining them should more or less give the same execution result as Scratch 2.0, minus unknown quirks.\r\n\r\nI've tried to document what's going on. Some of them are a little undocumented/mysterious in the 2.0 codebase. E.g., the 2.0 implementation of `compare` also includes (what I think is) a cache of lowercased values, not sure if we actually need this or if it was an unneeded optimization. Similarly, 2.0 simplifies `isNaN` using the `n != n` trick. I took this out for now but I imagine we could add it back in if profiling says isNaN is very slow.","created_at":"2016-08-11T22:54:18Z","updated_at":"2016-08-11T22:54:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a0d911322e7d8287628c2a32d35a8acf1ef30ca","assignee":{"login":"thisandagain","id":747641,"avatar_url":"https://avatars.githubusercontent.com/u/747641?v=3","gravatar_id":"","url":"https://api.github.com/users/thisandagain","html_url":"https://github.com/thisandagain","followers_url":"https://api.github.com/users/thisandagain/followers","following_url":"https://api.github.com/users/thisandagain/following{/other_user}","gists_url":"https://api.github.com/users/thisandagain/gists{/gist_id}","starred_url":"https://api.github.com/users/thisandagain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisandagain/subscriptions","organizations_url":"https://api.github.com/users/thisandagain/orgs","repos_url":"https://api.github.com/users/thisandagain/repos","events_url":"https://api.github.com/users/thisandagain/events{/privacy}","received_events_url":"https://api.github.com/users/thisandagain/received_events","type":"User","site_admin":false},"assignees":[{"login":"thisandagain","id":747641,"avatar_url":"https://avatars.githubusercontent.com/u/747641?v=3","gravatar_id":"","url":"https://api.github.com/users/thisandagain","html_url":"https://github.com/thisandagain","followers_url":"https://api.github.com/users/thisandagain/followers","following_url":"https://api.github.com/users/thisandagain/following{/other_user}","gists_url":"https://api.github.com/users/thisandagain/gists{/gist_id}","starred_url":"https://api.github.com/users/thisandagain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thisandagain/subscriptions","organizations_url":"https://api.github.com/users/thisandagain/orgs","repos_url":"https://api.github.com/users/thisandagain/repos","events_url":"https://api.github.com/users/thisandagain/events{/privacy}","received_events_url":"https://api.github.com/users/thisandagain/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/LLK/scratch-vm/pulls/101/commits","review_comments_url":"https://api.github.com/repos/LLK/scratch-vm/pulls/101/comments","review_comment_url":"https://api.github.com/repos/LLK/scratch-vm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LLK/scratch-vm/issues/101/comments","statuses_url":"https://api.github.com/repos/LLK/scratch-vm/statuses/bfe007e29f42dd0362d4901474d224826d0c1762","head":{"label":"tmickel:feature/operators","ref":"feature/operators","sha":"bfe007e29f42dd0362d4901474d224826d0c1762","user":{"login":"tmickel","id":120403,"avatar_url":"https://avatars.githubusercontent.com/u/120403?v=3","gravatar_id":"","url":"https://api.github.com/users/tmickel","html_url":"https://github.com/tmickel","followers_url":"https://api.github.com/users/tmickel/followers","following_url":"https://api.github.com/users/tmickel/following{/other_user}","gists_url":"https://api.github.com/users/tmickel/gists{/gist_id}","starred_url":"https://api.github.com/users/tmickel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmickel/subscriptions","organizations_url":"https://api.github.com/users/tmickel/orgs","repos_url":"https://api.github.com/users/tmickel/repos","events_url":"https://api.github.com/users/tmickel/events{/privacy}","received_events_url":"https://api.github.com/users/tmickel/received_events","type":"User","site_admin":false},"repo":{"id":60183520,"name":"scratch-vm","full_name":"tmickel/scratch-vm","owner":{"login":"tmickel","id":120403,"avatar_url":"https://avatars.githubusercontent.com/u/120403?v=3","gravatar_id":"","url":"https://api.github.com/users/tmickel","html_url":"https://github.com/tmickel","followers_url":"https://api.github.com/users/tmickel/followers","following_url":"https://api.github.com/users/tmickel/following{/other_user}","gists_url":"https://api.github.com/users/tmickel/gists{/gist_id}","starred_url":"https://api.github.com/users/tmickel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmickel/subscriptions","organizations_url":"https://api.github.com/users/tmickel/orgs","repos_url":"https://api.github.com/users/tmickel/repos","events_url":"https://api.github.com/users/tmickel/events{/privacy}","received_events_url":"https://api.github.com/users/tmickel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tmickel/scratch-vm","description":"Virtual Machine for Scratch Blocks","fork":true,"url":"https://api.github.com/repos/tmickel/scratch-vm","forks_url":"https://api.github.com/repos/tmickel/scratch-vm/forks","keys_url":"https://api.github.com/repos/tmickel/scratch-vm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tmickel/scratch-vm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tmickel/scratch-vm/teams","hooks_url":"https://api.github.com/repos/tmickel/scratch-vm/hooks","issue_events_url":"https://api.github.com/repos/tmickel/scratch-vm/issues/events{/number}","events_url":"https://api.github.com/repos/tmickel/scratch-vm/events","assignees_url":"https://api.github.com/repos/tmickel/scratch-vm/assignees{/user}","branches_url":"https://api.github.com/repos/tmickel/scratch-vm/branches{/branch}","tags_url":"https://api.github.com/repos/tmickel/scratch-vm/tags","blobs_url":"https://api.github.com/repos/tmickel/scratch-vm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tmickel/scratch-vm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tmickel/scratch-vm/git/refs{/sha}","trees_url":"https://api.github.com/repos/tmickel/scratch-vm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tmickel/scratch-vm/statuses/{sha}","languages_url":"https://api.github.com/repos/tmickel/scratch-vm/languages","stargazers_url":"https://api.github.com/repos/tmickel/scratch-vm/stargazers","contributors_url":"https://api.github.com/repos/tmickel/scratch-vm/contributors","subscribers_url":"https://api.github.com/repos/tmickel/scratch-vm/subscribers","subscription_url":"https://api.github.com/repos/tmickel/scratch-vm/subscription","commits_url":"https://api.github.com/repos/tmickel/scratch-vm/commits{/sha}","git_commits_url":"https://api.github.com/repos/tmickel/scratch-vm/git/commits{/sha}","comments_url":"https://api.github.com/repos/tmickel/scratch-vm/comments{/number}","issue_comment_url":"https://api.github.com/repos/tmickel/scratch-vm/issues/comments{/number}","contents_url":"https://api.github.com/repos/tmickel/scratch-vm/contents/{+path}","compare_url":"https://api.github.com/repos/tmickel/scratch-vm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tmickel/scratch-vm/merges","archive_url":"https://api.github.com/repos/tmickel/scratch-vm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tmickel/scratch-vm/downloads","issues_url":"https://api.github.com/repos/tmickel/scratch-vm/issues{/number}","pulls_url":"https://api.github.com/repos/tmickel/scratch-vm/pulls{/number}","milestones_url":"https://api.github.com/repos/tmickel/scratch-vm/milestones{/number}","notifications_url":"https://api.github.com/repos/tmickel/scratch-vm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tmickel/scratch-vm/labels{/name}","releases_url":"https://api.github.com/repos/tmickel/scratch-vm/releases{/id}","deployments_url":"https://api.github.com/repos/tmickel/scratch-vm/deployments","created_at":"2016-06-01T14:21:58Z","updated_at":"2016-06-01T14:21:59Z","pushed_at":"2016-08-11T22:48:07Z","git_url":"git://github.com/tmickel/scratch-vm.git","ssh_url":"git@github.com:tmickel/scratch-vm.git","clone_url":"https://github.com/tmickel/scratch-vm.git","svn_url":"https://github.com/tmickel/scratch-vm","homepage":"https://scratch.mit.edu/developers","size":292,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"LLK:develop","ref":"develop","sha":"4c67fc3bae213689c19d20dbd46670f9e93d4406","user":{"login":"LLK","id":3420800,"avatar_url":"https://avatars.githubusercontent.com/u/3420800?v=3","gravatar_id":"","url":"https://api.github.com/users/LLK","html_url":"https://github.com/LLK","followers_url":"https://api.github.com/users/LLK/followers","following_url":"https://api.github.com/users/LLK/following{/other_user}","gists_url":"https://api.github.com/users/LLK/gists{/gist_id}","starred_url":"https://api.github.com/users/LLK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLK/subscriptions","organizations_url":"https://api.github.com/users/LLK/orgs","repos_url":"https://api.github.com/users/LLK/repos","events_url":"https://api.github.com/users/LLK/events{/privacy}","received_events_url":"https://api.github.com/users/LLK/received_events","type":"Organization","site_admin":false},"repo":{"id":55796146,"name":"scratch-vm","full_name":"LLK/scratch-vm","owner":{"login":"LLK","id":3420800,"avatar_url":"https://avatars.githubusercontent.com/u/3420800?v=3","gravatar_id":"","url":"https://api.github.com/users/LLK","html_url":"https://github.com/LLK","followers_url":"https://api.github.com/users/LLK/followers","following_url":"https://api.github.com/users/LLK/following{/other_user}","gists_url":"https://api.github.com/users/LLK/gists{/gist_id}","starred_url":"https://api.github.com/users/LLK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LLK/subscriptions","organizations_url":"https://api.github.com/users/LLK/orgs","repos_url":"https://api.github.com/users/LLK/repos","events_url":"https://api.github.com/users/LLK/events{/privacy}","received_events_url":"https://api.github.com/users/LLK/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LLK/scratch-vm","description":"Virtual Machine for Scratch Blocks","fork":false,"url":"https://api.github.com/repos/LLK/scratch-vm","forks_url":"https://api.github.com/repos/LLK/scratch-vm/forks","keys_url":"https://api.github.com/repos/LLK/scratch-vm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LLK/scratch-vm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LLK/scratch-vm/teams","hooks_url":"https://api.github.com/repos/LLK/scratch-vm/hooks","issue_events_url":"https://api.github.com/repos/LLK/scratch-vm/issues/events{/number}","events_url":"https://api.github.com/repos/LLK/scratch-vm/events","assignees_url":"https://api.github.com/repos/LLK/scratch-vm/assignees{/user}","branches_url":"https://api.github.com/repos/LLK/scratch-vm/branches{/branch}","tags_url":"https://api.github.com/repos/LLK/scratch-vm/tags","blobs_url":"https://api.github.com/repos/LLK/scratch-vm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LLK/scratch-vm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LLK/scratch-vm/git/refs{/sha}","trees_url":"https://api.github.com/repos/LLK/scratch-vm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LLK/scratch-vm/statuses/{sha}","languages_url":"https://api.github.com/repos/LLK/scratch-vm/languages","stargazers_url":"https://api.github.com/repos/LLK/scratch-vm/stargazers","contributors_url":"https://api.github.com/repos/LLK/scratch-vm/contributors","subscribers_url":"https://api.github.com/repos/LLK/scratch-vm/subscribers","subscription_url":"https://api.github.com/repos/LLK/scratch-vm/subscription","commits_url":"https://api.github.com/repos/LLK/scratch-vm/commits{/sha}","git_commits_url":"https://api.github.com/repos/LLK/scratch-vm/git/commits{/sha}","comments_url":"https://api.github.com/repos/LLK/scratch-vm/comments{/number}","issue_comment_url":"https://api.github.com/repos/LLK/scratch-vm/issues/comments{/number}","contents_url":"https://api.github.com/repos/LLK/scratch-vm/contents/{+path}","compare_url":"https://api.github.com/repos/LLK/scratch-vm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LLK/scratch-vm/merges","archive_url":"https://api.github.com/repos/LLK/scratch-vm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LLK/scratch-vm/downloads","issues_url":"https://api.github.com/repos/LLK/scratch-vm/issues{/number}","pulls_url":"https://api.github.com/repos/LLK/scratch-vm/pulls{/number}","milestones_url":"https://api.github.com/repos/LLK/scratch-vm/milestones{/number}","notifications_url":"https://api.github.com/repos/LLK/scratch-vm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LLK/scratch-vm/labels{/name}","releases_url":"https://api.github.com/repos/LLK/scratch-vm/releases{/id}","deployments_url":"https://api.github.com/repos/LLK/scratch-vm/deployments","created_at":"2016-04-08T17:08:04Z","updated_at":"2016-08-08T07:45:56Z","pushed_at":"2016-08-11T19:45:19Z","git_url":"git://github.com/LLK/scratch-vm.git","ssh_url":"git@github.com:LLK/scratch-vm.git","clone_url":"https://github.com/LLK/scratch-vm.git","svn_url":"https://github.com/LLK/scratch-vm","homepage":"https://scratch.mit.edu/developers","size":721,"stargazers_count":45,"watchers_count":45,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":17,"forks":13,"open_issues":17,"watchers":45,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/LLK/scratch-vm/pulls/101"},"html":{"href":"https://github.com/LLK/scratch-vm/pull/101"},"issue":{"href":"https://api.github.com/repos/LLK/scratch-vm/issues/101"},"comments":{"href":"https://api.github.com/repos/LLK/scratch-vm/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/LLK/scratch-vm/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/LLK/scratch-vm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LLK/scratch-vm/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/LLK/scratch-vm/statuses/bfe007e29f42dd0362d4901474d224826d0c1762"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":170,"deletions":18,"changed_files":2}}
{"actor":{"display_login":"tmickel"}}