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

Side by Side Diff: lib/src/utils.dart

Issue 1126713002: fixes #130, accept anything with `iterator` in for loops (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix iterator Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Holds a couple utility functions used at various places in the system. 5 /// Holds a couple utility functions used at various places in the system.
6 library dev_compiler.src.utils; 6 library dev_compiler.src.utils;
7 7
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 }); 417 });
418 // Add getters. 418 // Add getters.
419 element.accessors 419 element.accessors
420 .where((member) => !member.isStatic && member.isGetter) 420 .where((member) => !member.isStatic && member.isGetter)
421 .forEach((member) { 421 .forEach((member) {
422 map[member.name] = member.type.returnType; 422 map[member.name] = member.type.returnType;
423 }); 423 });
424 } 424 }
425 return map; 425 return map;
426 } 426 }
427
428 /// Searches all supertype, in order of most derived members, to see if any
429 /// [match] a condition. If so, returns the first match, otherwise returns null.
430 InterfaceType findSupertype(InterfaceType type, bool match(InterfaceType t)) {
431 for (var m in type.mixins.reversed) {
432 if (match(m)) return m;
433 }
434 var s = type.superclass;
435 if (s == null) return null;
436
437 if (match(s)) return type;
438 return findSupertype(s, match);
439 }
OLDNEW
« lib/src/codegen/js_codegen.dart ('K') | « lib/src/codegen/js_codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698