{"action":"created","issue":{"url":"https://api.github.com/repos/Khan/Prototope/issues/47","labels_url":"https://api.github.com/repos/Khan/Prototope/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/Khan/Prototope/issues/47/comments","events_url":"https://api.github.com/repos/Khan/Prototope/issues/47/events","html_url":"https://github.com/Khan/Prototope/pull/47","id":60225691,"number":47,"title":"POC: Wrap bridged types to throw when called as a function","user":{"login":"spicyj","id":6820,"avatar_url":"https://avatars.githubusercontent.com/u/6820?v=3","gravatar_id":"","url":"https://api.github.com/users/spicyj","html_url":"https://github.com/spicyj","followers_url":"https://api.github.com/users/spicyj/followers","following_url":"https://api.github.com/users/spicyj/following{/other_user}","gists_url":"https://api.github.com/users/spicyj/gists{/gist_id}","starred_url":"https://api.github.com/users/spicyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicyj/subscriptions","organizations_url":"https://api.github.com/users/spicyj/orgs","repos_url":"https://api.github.com/users/spicyj/repos","events_url":"https://api.github.com/users/spicyj/events{/privacy}","received_events_url":"https://api.github.com/users/spicyj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-07T21:36:34Z","updated_at":"2015-03-10T16:38:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Khan/Prototope/pulls/47","html_url":"https://github.com/Khan/Prototope/pull/47","diff_url":"https://github.com/Khan/Prototope/pull/47.diff","patch_url":"https://github.com/Khan/Prototope/pull/47.patch"},"body":"For #25: This shows how we might wrap the constructors so that they throw when called without `new`. In this example, I've hardcoded `TextLayer` as the only wrapped type, but we'd presumably want to wrap every instantiable type. When you call a type without `new`, you now get a protonope, as you might expect. (It always says line 5 though since that's where the `new Error()` call is in the wrap script -- not sure how to fix that easily.)\n\n![image](https://cloud.githubusercontent.com/assets/6820/6543388/951ca70a-c4ce-11e4-958a-0c888737fcd8.png)"},"comment":{"url":"https://api.github.com/repos/Khan/Prototope/issues/comments/78093515","html_url":"https://github.com/Khan/Prototope/pull/47#issuecomment-78093515","issue_url":"https://api.github.com/repos/Khan/Prototope/issues/47","id":78093515,"user":{"login":"spicyj","id":6820,"avatar_url":"https://avatars.githubusercontent.com/u/6820?v=3","gravatar_id":"","url":"https://api.github.com/users/spicyj","html_url":"https://github.com/spicyj","followers_url":"https://api.github.com/users/spicyj/followers","following_url":"https://api.github.com/users/spicyj/following{/other_user}","gists_url":"https://api.github.com/users/spicyj/gists{/gist_id}","starred_url":"https://api.github.com/users/spicyj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spicyj/subscriptions","organizations_url":"https://api.github.com/users/spicyj/orgs","repos_url":"https://api.github.com/users/spicyj/repos","events_url":"https://api.github.com/users/spicyj/events{/privacy}","received_events_url":"https://api.github.com/users/spicyj/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T16:38:10Z","updated_at":"2015-03-10T16:38:10Z","body":"(Yeah, just open a new PR.)"}}