Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Unified Diff: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate

Issue 1370513003: Update to handle expections in custom element's created constructor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/deps/dartium.deps/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
index bf8f0ffc2c5ef6293eeff7f52d9889876db75987..1feee18a678b0d8758e11800a10676e5ad2b1200 100644
--- a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
@@ -310,14 +310,19 @@ $else
if (_getJSClassName(reflectClass(customElementClass).superclass) != null && creating < 2) {
creating++;
- var dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
-
- // Need to remember the Dart class that was created for this custom so
- // return it and setup the blink_jsObject to the $this that we'll be working
- // with as we talk to blink.
- $this['dart_class'] = dartClass;
-
- creating--;
+ var dartClass;
+ try {
+ dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
+ } catch (e) {
+ dartClass = null;
+ } finally {
+ // Need to remember the Dart class that was created for this custom so
+ // return it and setup the blink_jsObject to the $this that we'll be working
+ // with as we talk to blink.
+ $this['dart_class'] = dartClass;
+
+ creating--;
+ }
}
});
elemProto['attributeChangedCallback'] = new js.JsFunction.withThis(($this, attrName, oldVal, newVal) {
« no previous file with comments | « tools/deps/dartium.deps/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698