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) { |