{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/test/issues/406","repository_url":"https://api.github.com/repos/dart-lang/test","labels_url":"https://api.github.com/repos/dart-lang/test/issues/406/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/test/issues/406/comments","events_url":"https://api.github.com/repos/dart-lang/test/issues/406/events","html_url":"https://github.com/dart-lang/test/issues/406","id":140394538,"number":406,"title":"registerElement exceptions swallowed","user":{"login":"eukreign","id":69960,"avatar_url":"https://avatars.githubusercontent.com/u/69960?v=3","gravatar_id":"","url":"https://api.github.com/users/eukreign","html_url":"https://github.com/eukreign","followers_url":"https://api.github.com/users/eukreign/followers","following_url":"https://api.github.com/users/eukreign/following{/other_user}","gists_url":"https://api.github.com/users/eukreign/gists{/gist_id}","starred_url":"https://api.github.com/users/eukreign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eukreign/subscriptions","organizations_url":"https://api.github.com/users/eukreign/orgs","repos_url":"https://api.github.com/users/eukreign/repos","events_url":"https://api.github.com/users/eukreign/events{/privacy}","received_events_url":"https://api.github.com/users/eukreign/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-12T15:49:51Z","updated_at":"2016-03-14T21:03:39Z","closed_at":"2016-03-14T20:36:19Z","body":"I'm trying to test some custom elements and if there is an exception in the `created()` constructor those exceptions are swallowed and later the only exception that bubbles up is that the element didn't get registered.\r\n\r\nHere is a contrived test to replicate the problem:\r\n\r\n```\r\nimport 'dart:html';\r\nimport 'package:test/test.dart';\r\n\r\nclass FooElement extends TableCellElement {\r\n    FooElement.created() : super.created() {\r\n        print('Creating foo!');\r\n        call_non_existant_method();\r\n        print('Done creating foo!');\r\n    }\r\n}\r\n\r\nvoid main() {\r\n    test(\"do bad things\", () {\r\n        document.registerElement('x-foo', FooElement, extendsTag: 'td');\r\n        FooElement foo = new Element.tag('td', 'x-foo');\r\n        print(foo.outerHtml);\r\n    });\r\n}\r\n```\r\n\r\nWhen running the above tests I expect to see some kind of error related to `call_non_existant_method()` instead I just get an exception that the element didn't register:\r\n\r\n```\r\n$ pub run test:test -p content-shell test/element_test.dart\r\n00:03 +0: do bad things                                                                            \r\nCreating foo!\r\n00:03 +0 -1: do bad things                                                                         \r\n  type 'HtmlElement' is not a subtype of type 'FooElement' of 'foo'.\r\n  amount_test.dart 15:30  main.<fn>\r\n  \r\n00:03 +0 -1: Some tests failed.            \r\n```\r\n\r\nIs there anyway to make the test runner report all of the exceptions?\r\n\r\n```\r\n$ dart --version\r\nDart VM version: 1.15.0 (Wed Mar  9 10:10:00 2016) on \"linux_x64\"\r\n$ dartium --version\r\nChromium 45.0.2454.0 \r\n```"},"comment":{"url":"https://api.github.com/repos/dart-lang/test/issues/comments/196520711","html_url":"https://github.com/dart-lang/test/issues/406#issuecomment-196520711","issue_url":"https://api.github.com/repos/dart-lang/test/issues/406","id":196520711,"user":{"login":"eukreign","id":69960,"avatar_url":"https://avatars.githubusercontent.com/u/69960?v=3","gravatar_id":"","url":"https://api.github.com/users/eukreign","html_url":"https://github.com/eukreign","followers_url":"https://api.github.com/users/eukreign/followers","following_url":"https://api.github.com/users/eukreign/following{/other_user}","gists_url":"https://api.github.com/users/eukreign/gists{/gist_id}","starred_url":"https://api.github.com/users/eukreign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eukreign/subscriptions","organizations_url":"https://api.github.com/users/eukreign/orgs","repos_url":"https://api.github.com/users/eukreign/repos","events_url":"https://api.github.com/users/eukreign/events{/privacy}","received_events_url":"https://api.github.com/users/eukreign/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T21:03:39Z","updated_at":"2016-03-14T21:03:39Z","body":"Okay, I've verified that the following example works. I created a `test.html` with the following content:\r\n\r\n```html\r\n<script type=\"application/dart\">\r\nimport 'dart:html';\r\n\r\nclass FooElement extends HtmlElement {\r\n  FooElement.created() : super.created();\r\n  attached() {\r\n    print('Creating foo!');\r\n    call_non_existant_method();\r\n    print('Done creating foo!');\r\n  }\r\n}\r\n\r\nvoid main() {\r\n  try {\r\n    document.registerElement('x-foo', FooElement);\r\n    FooElement foo = new Element.tag('x-foo');\r\n    print(foo.outerHtml);\r\n  } catch (error) {\r\n    print(error);\r\n  }\r\n}\r\n</script>\r\n<x-foo></x-foo>\r\n```\r\n\r\nAnd opening in latest Dartium produced the following:\r\n\r\n![screenshot from 2016-03-14 17-01-43](https://cloud.githubusercontent.com/assets/69960/13759853/93feb2b0-ea06-11e5-96dc-548fa97f5cf6.png)\r\n"}}