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

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

Issue 1987073002: Strip unused functionality from dart:html and fix strong mode errors. Switch from blacklisting pure… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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_Window.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index c9f82796bb954f0b4c9e93e627a53c9e4de1d217..8abac3775c4146f65b923db522ae32ae4fa881ac 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -339,8 +339,10 @@ class _BeforeUnloadEventStreamProvider implements
const _BeforeUnloadEventStreamProvider(this._eventType);
Stream<BeforeUnloadEvent> forTarget(EventTarget e, {bool useCapture: false}) {
- var stream = new _EventStream(e, _eventType, useCapture);
$if DART2JS
+ // Specify the generic type for EventStream only in dart2js to avoid
+ // checked mode errors in dartium.
+ var stream = new _EventStream<BeforeUnloadEvent>(e, _eventType, useCapture);
var controller = new StreamController<BeforeUnloadEvent>(sync: true);
stream.listen((event) {
@@ -350,6 +352,7 @@ $if DART2JS
return controller.stream;
$else
+ var stream = new _EventStream(e, _eventType, useCapture);
return stream;
$endif
}
@@ -359,11 +362,23 @@ $endif
}
ElementStream<BeforeUnloadEvent> forElement(Element e, {bool useCapture: false}) {
+$if DART2JS
+ // Specify the generic type for _ElementEventStreamImpl only in dart2js to
+ // avoid checked mode errors in dartium.
+ return new _ElementEventStreamImpl<BeforeUnloadEvent>(e, _eventType, useCapture);
+$else
return new _ElementEventStreamImpl(e, _eventType, useCapture);
+$endif
}
ElementStream<BeforeUnloadEvent> _forElementList(ElementList e,
{bool useCapture: false}) {
+$if DART2JS
+ // Specify the generic type for _ElementEventStreamImpl only in dart2js to
+ // avoid checked mode errors in dartium.
+ return new _ElementListEventStreamImpl<BeforeUnloadEvent>(e, _eventType, useCapture);
+$else
return new _ElementListEventStreamImpl(e, _eventType, useCapture);
+$endif
}
}

Powered by Google App Engine
This is Rietveld 408576698