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

Unified Diff: tests/compiler/dart2js/mock_libraries.dart

Issue 1334673002: Add warnings and hints to for-in. (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: tests/compiler/dart2js/mock_libraries.dart
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index 137245849102c86a0b01edc0a3d5f536e75bcab5..5de30cbb14c140b79eb4da8dc20a88828afe6988 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -45,7 +45,14 @@ const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{
}''',
'identical': 'bool identical(Object a, Object b) { return true; }',
'int': 'abstract class int extends num { }',
- 'Iterable': 'abstract class Iterable {}',
+ 'Iterable': '''
+ abstract class Iterable<E> {
+ Iterator<E> get iterator => null;
+ }''',
+ 'Iterator': '''
+ abstract class Iterator<E> {
+ E get current => null;
+ }''',
'LinkedHashMap': r'''
class LinkedHashMap {
factory LinkedHashMap._empty() => null;
@@ -54,7 +61,7 @@ const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{
static _makeLiteral(elements) => null;
}''',
'List': r'''
- class List<E> {
+ class List<E> extends Iterable<E> {
var length;
List([length]);
List.filled(length, element);
@@ -286,6 +293,7 @@ const Map<String, String> DEFAULT_INTERCEPTORS_LIBRARY = const <String, String>{
E removeAt(index) => this[0];
E elementAt(index) => this[0];
E singleWhere(f) => this[0];
+ Iterator<E> get iterator => null;
}''',
'JSBool': 'class JSBool extends Interceptor implements bool {}',
'JSDouble': 'class JSDouble extends JSNumber implements double {}',
@@ -384,7 +392,7 @@ const Map<String, String> DEFAULT_ISOLATE_HELPER_LIBRARY =
const Map<String, String> DEFAULT_ASYNC_LIBRARY = const <String, String>{
'DeferredLibrary': 'class DeferredLibrary {}',
- 'Future':
+ 'Future':
'''
class Future<T> {
Future.value([value]);

Powered by Google App Engine
This is Rietveld 408576698