{"action":"opened","issue":{"url":"https://api.github.com/repos/bridgedotnet/Bridge/issues/1083","repository_url":"https://api.github.com/repos/bridgedotnet/Bridge","labels_url":"https://api.github.com/repos/bridgedotnet/Bridge/issues/1083/labels{/name}","comments_url":"https://api.github.com/repos/bridgedotnet/Bridge/issues/1083/comments","events_url":"https://api.github.com/repos/bridgedotnet/Bridge/issues/1083/events","html_url":"https://github.com/bridgedotnet/Bridge/issues/1083","id":142124656,"number":1083,"title":"enumType.prototype is undefined","user":{"login":"geoffreymcgill","id":62210,"avatar_url":"https://avatars.githubusercontent.com/u/62210?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffreymcgill","html_url":"https://github.com/geoffreymcgill","followers_url":"https://api.github.com/users/geoffreymcgill/followers","following_url":"https://api.github.com/users/geoffreymcgill/following{/other_user}","gists_url":"https://api.github.com/users/geoffreymcgill/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffreymcgill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffreymcgill/subscriptions","organizations_url":"https://api.github.com/users/geoffreymcgill/orgs","repos_url":"https://api.github.com/users/geoffreymcgill/repos","events_url":"https://api.github.com/users/geoffreymcgill/events{/privacy}","received_events_url":"https://api.github.com/users/geoffreymcgill/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bridgedotnet/Bridge/labels/defect","name":"defect","color":"FF4136"}],"state":"open","locked":false,"assignee":{"login":"vladsch","id":378225,"avatar_url":"https://avatars.githubusercontent.com/u/378225?v=3","gravatar_id":"","url":"https://api.github.com/users/vladsch","html_url":"https://github.com/vladsch","followers_url":"https://api.github.com/users/vladsch/followers","following_url":"https://api.github.com/users/vladsch/following{/other_user}","gists_url":"https://api.github.com/users/vladsch/gists{/gist_id}","starred_url":"https://api.github.com/users/vladsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladsch/subscriptions","organizations_url":"https://api.github.com/users/vladsch/orgs","repos_url":"https://api.github.com/users/vladsch/repos","events_url":"https://api.github.com/users/vladsch/events{/privacy}","received_events_url":"https://api.github.com/users/vladsch/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/bridgedotnet/Bridge/milestones/19","html_url":"https://github.com/bridgedotnet/Bridge/milestones/1.12","labels_url":"https://api.github.com/repos/bridgedotnet/Bridge/milestones/19/labels","id":1526775,"number":19,"title":"1.12","description":"","creator":{"login":"geoffreymcgill","id":62210,"avatar_url":"https://avatars.githubusercontent.com/u/62210?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffreymcgill","html_url":"https://github.com/geoffreymcgill","followers_url":"https://api.github.com/users/geoffreymcgill/followers","following_url":"https://api.github.com/users/geoffreymcgill/following{/other_user}","gists_url":"https://api.github.com/users/geoffreymcgill/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffreymcgill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffreymcgill/subscriptions","organizations_url":"https://api.github.com/users/geoffreymcgill/orgs","repos_url":"https://api.github.com/users/geoffreymcgill/repos","events_url":"https://api.github.com/users/geoffreymcgill/events{/privacy}","received_events_url":"https://api.github.com/users/geoffreymcgill/received_events","type":"User","site_admin":false},"open_issues":50,"closed_issues":21,"state":"open","created_at":"2016-01-20T18:45:02Z","updated_at":"2016-03-20T03:23:44Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-03-20T03:23:44Z","updated_at":"2016-03-20T03:23:44Z","closed_at":null,"body":"Related to forum thread:\r\n\r\nhttp://forums.bridge.net/forum/bridge-net-pro/bugs/1875-bridge-enum-tostring-fails-on-external-enums\r\n\r\n### Expected\r\n\r\nReturn enum value\r\n\r\n### Actual\r\n\r\nThrows **TypeError: enumType.prototype is undefined** error\r\n\r\n### Steps To Reproduce\r\n\r\n```csharp\r\npublic class App\r\n{\r\n    [Ready]\r\n    public static void Main()\r\n    {\r\n        // simulate declaration of external enum \r\n        Script.Write(\"Demo.Foo = {};\");\r\n        Script.Write(\"Demo.Foo.OK = 'OK';\");\r\n        Script.Write(\"Demo.Foo.FAIL = 'FAIL';\");\r\n\r\n        var status = Foo.Ok;\r\n        \r\n        Console.Log(status); // fail on enumType.prototype.$enum\r\n    }\r\n}\r\n\r\n[External]\r\n[Enum(Emit.Name)]\r\npublic enum Foo\r\n{\r\n    [Name(\"OK\")]\r\n    Ok,\r\n    \r\n    [Name(\"FAIL\")]\r\n    Fail\r\n}\r\n```"}}