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

Unified Diff: tool/input_sdk/lib/html/dart2js/html_dart2js.dart

Issue 1907353003: Update sdk removing explicit as checks. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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:
Download patch
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/tool/input_sdk/lib/html/dart2js/html_dart2js.dart b/tool/input_sdk/lib/html/dart2js/html_dart2js.dart
index 32f6d2bd1e52c8326678d8e3b64b38195d7d1398..1d4407bd3319bce10102472c62b0664454219acb 100644
--- a/tool/input_sdk/lib/html/dart2js/html_dart2js.dart
+++ b/tool/input_sdk/lib/html/dart2js/html_dart2js.dart
@@ -12436,7 +12436,7 @@ class _FrozenElementList<E extends Element> extends ListBase<E>
int get length => _nodeList.length;
- E operator [](int index) => _nodeList[index] as E;
+ E operator [](int index) => _downcast/*<Node, E>*/(_nodeList[index]);
void operator []=(int index, E value) {
throw new UnsupportedError('Cannot modify list');
@@ -12454,11 +12454,11 @@ class _FrozenElementList<E extends Element> extends ListBase<E>
throw new UnsupportedError('Cannot shuffle list');
}
- E get first => _nodeList.first as E;
+ E get first => _downcast/*<Node, E>*/(_nodeList.first);
- E get last => _nodeList.last as E;
+ E get last => _downcast/*<Node, E>*/(_nodeList.last);
- E get single => _nodeList.single as E;
+ E get single => _downcast/*<Node, E>*/(_nodeList.single);
CssClassSet get classes => new _MultiElementCssClassSet(this);
@@ -14836,7 +14836,7 @@ class Element extends Node implements NonDocumentTypeChildNode, GlobalEventHandl
@DocsEditable()
bool hidden;
- // Using properties as subclasses overload.
+ // Using property as subclass shadows.
bool get isContentEditable => JS("bool", "#.isContentEditable", this);
@DomName('Element.lang')
@@ -14962,7 +14962,7 @@ class Element extends Node implements NonDocumentTypeChildNode, GlobalEventHandl
// Use implementation from Node.
// final String _namespaceUri;
- // Using properties as subclasses overload.
+ // Using property as subclass shadows.
String get outerHtml => JS("String", "#.outerHTML", this);
@JSName('scrollHeight')
@@ -42542,13 +42542,13 @@ class _WrappedList<E extends Node> extends ListBase<E>
// List APIs
- E operator [](int index) => _list[index] as E;
+ E operator [](int index) => _downcast/*<Node, E>*/(_list[index]);
void operator []=(int index, E value) { _list[index] = value; }
set length(int newLength) { _list.length = newLength; }
- void sort([int compare(E a, E b)]) { _list.sort((Node a, Node b) => compare(a as E, b as E)); }
+ void sort([int compare(E a, E b)]) { _list.sort((Node a, Node b) => compare(_downcast/*<Node, E>*/(a), _downcast/*<Node, E>*/(b))); }
int indexOf(Object element, [int start = 0]) => _list.indexOf(element, start);
@@ -42556,7 +42556,7 @@ class _WrappedList<E extends Node> extends ListBase<E>
void insert(int index, E element) => _list.insert(index, element);
- E removeAt(int index) => _list.removeAt(index) as E;
+ E removeAt(int index) => _downcast/*<Node, E>*/(_list.removeAt(index));
void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) {
_list.setRange(start, end, iterable, skipCount);
@@ -42578,7 +42578,7 @@ class _WrappedList<E extends Node> extends ListBase<E>
/**
* Iterator wrapper for _WrappedList.
*/
-class _WrappedIterator<E> implements Iterator<E> {
+class _WrappedIterator<E extends Node> implements Iterator<E> {
Iterator<Node> _iterator;
_WrappedIterator(this._iterator);
@@ -42587,8 +42587,11 @@ class _WrappedIterator<E> implements Iterator<E> {
return _iterator.moveNext();
}
- E get current => _iterator.current as E;
+ E get current => _downcast/*<Node, E>*/(_iterator.current);
}
+
+// ignore: STRONG_MODE_DOWN_CAST_COMPOSITE
+/*=To*/ _downcast/*<From, To extends From>*/(dynamic /*=From*/ x) => x;
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | tool/input_sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698