{"action":"opened","number":542,"pull_request":{"url":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/542","id":203397757,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzMzk3NzU3","html_url":"https://github.com/rustwasm/wasm-bindgen/pull/542","diff_url":"https://github.com/rustwasm/wasm-bindgen/pull/542.diff","patch_url":"https://github.com/rustwasm/wasm-bindgen/pull/542.patch","issue_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/542","number":542,"state":"open","locked":false,"title":"Implement Math.min() and Math.max() bindings","user":{"login":"twilco","id":6610100,"node_id":"MDQ6VXNlcjY2MTAxMDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6610100?v=4","gravatar_id":"","url":"https://api.github.com/users/twilco","html_url":"https://github.com/twilco","followers_url":"https://api.github.com/users/twilco/followers","following_url":"https://api.github.com/users/twilco/following{/other_user}","gists_url":"https://api.github.com/users/twilco/gists{/gist_id}","starred_url":"https://api.github.com/users/twilco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twilco/subscriptions","organizations_url":"https://api.github.com/users/twilco/orgs","repos_url":"https://api.github.com/users/twilco/repos","events_url":"https://api.github.com/users/twilco/events{/privacy}","received_events_url":"https://api.github.com/users/twilco/received_events","type":"User","site_admin":false},"body":"`Math.min()` and `Math.max()` for #275.\r\n\r\nAnd while I have your attention... :)\r\n\r\nHow do we want to do constants?  Doesn't look like anyone has made a constant for any binding yet.  Tried this, but figured it was too good to be true.\r\n\r\n```\r\n// Math\r\n#[wasm_bindgen]\r\nextern \"C\" {\r\n    pub type Math;\r\n\r\n    const E: f64 = 2.718281828459045;\r\n\r\n    /// The Math.abs() function returns the absolute value of a number, that is\r\n    /// Math.abs(x) = |x|\r\n    ///\r\n    /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/abs\r\n    #[wasm_bindgen(static_method_of = Math)]\r\n    pub fn abs(x: f64) -> f64;\r\n```\r\n\r\nError message is: Static constants in extern blocks cannot have values\r\n\r\n`let` also does not work.  ","created_at":"2018-07-24T03:09:33Z","updated_at":"2018-07-24T03:09:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/542/commits","review_comments_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/542/comments","review_comment_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/542/comments","statuses_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/statuses/7624db90e1a16214dfe60c87145117f197adbd9d","head":{"label":"twilco:master","ref":"master","sha":"7624db90e1a16214dfe60c87145117f197adbd9d","user":{"login":"twilco","id":6610100,"node_id":"MDQ6VXNlcjY2MTAxMDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6610100?v=4","gravatar_id":"","url":"https://api.github.com/users/twilco","html_url":"https://github.com/twilco","followers_url":"https://api.github.com/users/twilco/followers","following_url":"https://api.github.com/users/twilco/following{/other_user}","gists_url":"https://api.github.com/users/twilco/gists{/gist_id}","starred_url":"https://api.github.com/users/twilco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twilco/subscriptions","organizations_url":"https://api.github.com/users/twilco/orgs","repos_url":"https://api.github.com/users/twilco/repos","events_url":"https://api.github.com/users/twilco/events{/privacy}","received_events_url":"https://api.github.com/users/twilco/received_events","type":"User","site_admin":false},"repo":{"id":141839272,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE4MzkyNzI=","name":"wasm-bindgen","full_name":"twilco/wasm-bindgen","owner":{"login":"twilco","id":6610100,"node_id":"MDQ6VXNlcjY2MTAxMDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6610100?v=4","gravatar_id":"","url":"https://api.github.com/users/twilco","html_url":"https://github.com/twilco","followers_url":"https://api.github.com/users/twilco/followers","following_url":"https://api.github.com/users/twilco/following{/other_user}","gists_url":"https://api.github.com/users/twilco/gists{/gist_id}","starred_url":"https://api.github.com/users/twilco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twilco/subscriptions","organizations_url":"https://api.github.com/users/twilco/orgs","repos_url":"https://api.github.com/users/twilco/repos","events_url":"https://api.github.com/users/twilco/events{/privacy}","received_events_url":"https://api.github.com/users/twilco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/twilco/wasm-bindgen","description":"Facilitating high-level interactions between wasm modules and JavaScript","fork":true,"url":"https://api.github.com/repos/twilco/wasm-bindgen","forks_url":"https://api.github.com/repos/twilco/wasm-bindgen/forks","keys_url":"https://api.github.com/repos/twilco/wasm-bindgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twilco/wasm-bindgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twilco/wasm-bindgen/teams","hooks_url":"https://api.github.com/repos/twilco/wasm-bindgen/hooks","issue_events_url":"https://api.github.com/repos/twilco/wasm-bindgen/issues/events{/number}","events_url":"https://api.github.com/repos/twilco/wasm-bindgen/events","assignees_url":"https://api.github.com/repos/twilco/wasm-bindgen/assignees{/user}","branches_url":"https://api.github.com/repos/twilco/wasm-bindgen/branches{/branch}","tags_url":"https://api.github.com/repos/twilco/wasm-bindgen/tags","blobs_url":"https://api.github.com/repos/twilco/wasm-bindgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twilco/wasm-bindgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twilco/wasm-bindgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/twilco/wasm-bindgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twilco/wasm-bindgen/statuses/{sha}","languages_url":"https://api.github.com/repos/twilco/wasm-bindgen/languages","stargazers_url":"https://api.github.com/repos/twilco/wasm-bindgen/stargazers","contributors_url":"https://api.github.com/repos/twilco/wasm-bindgen/contributors","subscribers_url":"https://api.github.com/repos/twilco/wasm-bindgen/subscribers","subscription_url":"https://api.github.com/repos/twilco/wasm-bindgen/subscription","commits_url":"https://api.github.com/repos/twilco/wasm-bindgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/twilco/wasm-bindgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/twilco/wasm-bindgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/twilco/wasm-bindgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/twilco/wasm-bindgen/contents/{+path}","compare_url":"https://api.github.com/repos/twilco/wasm-bindgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twilco/wasm-bindgen/merges","archive_url":"https://api.github.com/repos/twilco/wasm-bindgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twilco/wasm-bindgen/downloads","issues_url":"https://api.github.com/repos/twilco/wasm-bindgen/issues{/number}","pulls_url":"https://api.github.com/repos/twilco/wasm-bindgen/pulls{/number}","milestones_url":"https://api.github.com/repos/twilco/wasm-bindgen/milestones{/number}","notifications_url":"https://api.github.com/repos/twilco/wasm-bindgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twilco/wasm-bindgen/labels{/name}","releases_url":"https://api.github.com/repos/twilco/wasm-bindgen/releases{/id}","deployments_url":"https://api.github.com/repos/twilco/wasm-bindgen/deployments","created_at":"2018-07-21T19:08:39Z","updated_at":"2018-07-24T03:01:06Z","pushed_at":"2018-07-24T03:01:04Z","git_url":"git://github.com/twilco/wasm-bindgen.git","ssh_url":"git@github.com:twilco/wasm-bindgen.git","clone_url":"https://github.com/twilco/wasm-bindgen.git","svn_url":"https://github.com/twilco/wasm-bindgen","homepage":"https://rustwasm.github.io/wasm-bindgen/","size":4152,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rustwasm:master","ref":"master","sha":"f437e06463fb096af04afaa405ad116b2e8f2ef7","user":{"login":"rustwasm","id":37272798,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MjcyNzk4","avatar_url":"https://avatars1.githubusercontent.com/u/37272798?v=4","gravatar_id":"","url":"https://api.github.com/users/rustwasm","html_url":"https://github.com/rustwasm","followers_url":"https://api.github.com/users/rustwasm/followers","following_url":"https://api.github.com/users/rustwasm/following{/other_user}","gists_url":"https://api.github.com/users/rustwasm/gists{/gist_id}","starred_url":"https://api.github.com/users/rustwasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustwasm/subscriptions","organizations_url":"https://api.github.com/users/rustwasm/orgs","repos_url":"https://api.github.com/users/rustwasm/repos","events_url":"https://api.github.com/users/rustwasm/events{/privacy}","received_events_url":"https://api.github.com/users/rustwasm/received_events","type":"Organization","site_admin":false},"repo":{"id":114685405,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ2ODU0MDU=","name":"wasm-bindgen","full_name":"rustwasm/wasm-bindgen","owner":{"login":"rustwasm","id":37272798,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM3MjcyNzk4","avatar_url":"https://avatars1.githubusercontent.com/u/37272798?v=4","gravatar_id":"","url":"https://api.github.com/users/rustwasm","html_url":"https://github.com/rustwasm","followers_url":"https://api.github.com/users/rustwasm/followers","following_url":"https://api.github.com/users/rustwasm/following{/other_user}","gists_url":"https://api.github.com/users/rustwasm/gists{/gist_id}","starred_url":"https://api.github.com/users/rustwasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustwasm/subscriptions","organizations_url":"https://api.github.com/users/rustwasm/orgs","repos_url":"https://api.github.com/users/rustwasm/repos","events_url":"https://api.github.com/users/rustwasm/events{/privacy}","received_events_url":"https://api.github.com/users/rustwasm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rustwasm/wasm-bindgen","description":"Facilitating high-level interactions between wasm modules and JavaScript","fork":false,"url":"https://api.github.com/repos/rustwasm/wasm-bindgen","forks_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/forks","keys_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/teams","hooks_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/hooks","issue_events_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/events{/number}","events_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/events","assignees_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/assignees{/user}","branches_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/branches{/branch}","tags_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/tags","blobs_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/statuses/{sha}","languages_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/languages","stargazers_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/stargazers","contributors_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/contributors","subscribers_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/subscribers","subscription_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/subscription","commits_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/contents/{+path}","compare_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/merges","archive_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/downloads","issues_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues{/number}","pulls_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls{/number}","milestones_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/milestones{/number}","notifications_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/labels{/name}","releases_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/releases{/id}","deployments_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/deployments","created_at":"2017-12-18T20:38:44Z","updated_at":"2018-07-24T00:52:12Z","pushed_at":"2018-07-24T01:16:26Z","git_url":"git://github.com/rustwasm/wasm-bindgen.git","ssh_url":"git@github.com:rustwasm/wasm-bindgen.git","clone_url":"https://github.com/rustwasm/wasm-bindgen.git","svn_url":"https://github.com/rustwasm/wasm-bindgen","homepage":"https://rustwasm.github.io/wasm-bindgen/","size":4232,"stargazers_count":1053,"watchers_count":1053,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":110,"mirror_url":null,"archived":false,"open_issues_count":76,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":110,"open_issues":76,"watchers":1053,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/542"},"html":{"href":"https://github.com/rustwasm/wasm-bindgen/pull/542"},"issue":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/542"},"comments":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/542/comments"},"review_comments":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/542/comments"},"review_comment":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/542/commits"},"statuses":{"href":"https://api.github.com/repos/rustwasm/wasm-bindgen/statuses/7624db90e1a16214dfe60c87145117f197adbd9d"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":6,"additions":30,"deletions":0,"changed_files":2}}
{"actor":{"display_login":"twilco"}}