{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon-js/issues/632","labels_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/632/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/632/comments","events_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/632/events","html_url":"https://github.com/ceylon/ceylon-js/issues/632","id":108140510,"number":632,"title":"Collect stack trace with Error.stack","user":{"login":"lucaswerkmeister","id":2346599,"avatar_url":"https://avatars.githubusercontent.com/u/2346599?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswerkmeister","html_url":"https://github.com/lucaswerkmeister","followers_url":"https://api.github.com/users/lucaswerkmeister/followers","following_url":"https://api.github.com/users/lucaswerkmeister/following{/other_user}","gists_url":"https://api.github.com/users/lucaswerkmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswerkmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswerkmeister/subscriptions","organizations_url":"https://api.github.com/users/lucaswerkmeister/orgs","repos_url":"https://api.github.com/users/lucaswerkmeister/repos","events_url":"https://api.github.com/users/lucaswerkmeister/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswerkmeister/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-24T14:19:03Z","updated_at":"2015-09-24T16:12:36Z","closed_at":null,"body":"`Throwable` [uses `.caller` to collect the stack trace](https://github.com/ceylon/ceylon.language/blob/32cb209ac27dfe559df992bb9757d5a3e8f7b798/runtime-js/Throwable_cons_before.js#L4). However, use of `.caller` is [explicitly prohibited](http://www.ecma-international.org/ecma-262/5.1/#sec-13.2) in ES5 strict mode; thus, attempting to create a `Throwable` in strict mode fails with a `TypeError`. (This was the cause of ceylon/ceylon-web-ide-backend#75.)\r\n\r\nAll modern engines also offer another way to get a stack trace: [`Error().stack`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack). This is, unfortunately, also unspecified, but available even in strict mode. Therefore, I think `Throwable` should try to use that first, and only fall back to `.caller` if `Error().stack` isn’t available."},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon-js/issues/comments/142975818","html_url":"https://github.com/ceylon/ceylon-js/issues/632#issuecomment-142975818","issue_url":"https://api.github.com/repos/ceylon/ceylon-js/issues/632","id":142975818,"user":{"login":"lucaswerkmeister","id":2346599,"avatar_url":"https://avatars.githubusercontent.com/u/2346599?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaswerkmeister","html_url":"https://github.com/lucaswerkmeister","followers_url":"https://api.github.com/users/lucaswerkmeister/followers","following_url":"https://api.github.com/users/lucaswerkmeister/following{/other_user}","gists_url":"https://api.github.com/users/lucaswerkmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaswerkmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaswerkmeister/subscriptions","organizations_url":"https://api.github.com/users/lucaswerkmeister/orgs","repos_url":"https://api.github.com/users/lucaswerkmeister/repos","events_url":"https://api.github.com/users/lucaswerkmeister/events{/privacy}","received_events_url":"https://api.github.com/users/lucaswerkmeister/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T16:12:36Z","updated_at":"2015-09-24T16:12:36Z","body":"Well, if an empty stacktrace isn’t a problem, sure :P\r\n\r\n(And yeah, this probably belongs in ceylon.language, didn’t think about that. Sorry.)"}}