Index: tools/dom/templates/html/impl/impl_Node.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate |
index 38fdab1d9973adda7e41de88d832baee9790be82..23b4afe8c94dbe26c20891a5b0334cbeb7744562 100644 |
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate |
@@ -197,7 +197,18 @@ $endif |
$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS { |
// Custom element created callback. |
+$if DART2JS |
Node._created() : super._created(); |
+$else |
+ Node._created() : super._created() { |
+ // By this point blink_jsObject should be setup if it's not then we weren't |
+ // called by the registerElement createdCallback - probably created() was |
+ // called directly which is verboten. |
+ if (this.blink_jsObject == null) { |
+ throw new DomException.jsInterop("the created constructor cannot be called directly"); |
+ } |
+ } |
+$endif |
/** |
* A modifiable list of this node's children. |