Index: tools/dom/templates/html/impl/impl_DOMException.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_DOMException.darttemplate b/tools/dom/templates/html/impl/impl_DOMException.darttemplate |
index be8c36c2b11232a2ceb3f80b5b724d81aa9eddf6..52bc39cbc5e9b443557022c867f31969b0afe77d 100644 |
--- a/tools/dom/templates/html/impl/impl_DOMException.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_DOMException.darttemplate |
@@ -40,7 +40,51 @@ $if DART2JS |
return errorName; |
} |
$endif |
+$if JSINTEROP |
+ String _name; |
+ String _message; |
+ |
+ // To suppress missing implicit constructor warnings. |
+ factory DomException._() { throw new UnsupportedError("Not supported"); } |
+ |
+ static DomException internalCreateDomException() { |
+ return new DomException._internalWrap(); |
+ } |
+ |
+ js.JsObject blink_jsObject; |
+ |
+ factory DomException._internalWrap() { |
+ return new class DomException.internal_(); |
+ } |
+ |
+ DomException.internal_() { } |
+ |
+ DomException.jsInterop(String m) { |
+ var name_index = m.indexOf(': '); |
+ if (name_index < 0) { |
+ _name = ""; |
+ _message = m; |
+ } else { |
+ _name = m.substring(0, name_index); |
+ _message = m.substring(name_index + 1).trim(); |
+ } |
+ } |
+ |
+ @DomName('DOMException.message') |
+ @DocsEditable() |
+ String get message => _message; |
+ |
+ @DomName('DOMException.name') |
+ @DocsEditable() |
+ String get name => _name; |
+ |
+ @DomName('DOMException.toString') |
+ @DocsEditable() |
+ String toString() => "${_name}: $_message"; |
+ |
+$else |
$!MEMBERS |
+$endif |
$if DART2JS |
@DomName('DOMException.toString') |
@DocsEditable() |