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

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

Issue 1349493003: Dartium JS Interop enabled. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
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..809b2e52ad5197fdd60b5960678a093f86430cb4 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 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()

Powered by Google App Engine
This is Rietveld 408576698