{"action":"opened","issue":{"url":"https://api.github.com/repos/whatwg/html/issues/715","repository_url":"https://api.github.com/repos/whatwg/html","labels_url":"https://api.github.com/repos/whatwg/html/issues/715/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/html/issues/715/comments","events_url":"https://api.github.com/repos/whatwg/html/issues/715/events","html_url":"https://github.com/whatwg/html/issues/715","id":134919889,"number":715,"title":"Need to be clearer about how aborted/terminated script evaluations are handled","user":{"login":"bzbarsky","id":1457979,"avatar_url":"https://avatars.githubusercontent.com/u/1457979?v=3","gravatar_id":"","url":"https://api.github.com/users/bzbarsky","html_url":"https://github.com/bzbarsky","followers_url":"https://api.github.com/users/bzbarsky/followers","following_url":"https://api.github.com/users/bzbarsky/following{/other_user}","gists_url":"https://api.github.com/users/bzbarsky/gists{/gist_id}","starred_url":"https://api.github.com/users/bzbarsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bzbarsky/subscriptions","organizations_url":"https://api.github.com/users/bzbarsky/orgs","repos_url":"https://api.github.com/users/bzbarsky/repos","events_url":"https://api.github.com/users/bzbarsky/events{/privacy}","received_events_url":"https://api.github.com/users/bzbarsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-19T17:13:27Z","updated_at":"2016-02-19T17:13:27Z","closed_at":null,"body":"In https://html.spec.whatwg.org/multipage/webappapis.html#run-a-classic-script we have:\r\n\r\n> Let evaluationStatus be ScriptEvaluation(result).\r\n\r\nand then the assertion is that if `evaluationStatus` is an abrupt completion then its `[[value]]` is \"an error object\".  Ignoring for the moment that it might not be an object at all (c.f. `throw 5`), the problem is what happens if `ScriptEvaluation` gets aborted by something like worker termination or the slow script detection in browsers.  In that situation we do NOT want to end up in step 10 at all, I believe.  We should instead end up in step 11, but callers should be able to detect the abort condition somehow.\r\n\r\nAs a data point, the way this is implemented in Gecko right now is that `ScriptEvaluation` returns an abrupt completion with no `[[value]]` when script is aborted.  Callers then know that this situation means an abort happened.  Of course that state needs to be propagated back out as needed, but our `ErrorResult` struct has an explicit representation for this case (which we call an \"uncatchable exception\")."}}