OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.test.src.context.context_test; | 5 library analyzer.test.src.context.context_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 2457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 | 2468 |
2469 class ClassTwo { | 2469 class ClassTwo { |
2470 // Implicit no-argument constructor | 2470 // Implicit no-argument constructor |
2471 } | 2471 } |
2472 | 2472 |
2473 void topLevelFunctionWithLocalFunction() { | 2473 void topLevelFunctionWithLocalFunction() { |
2474 void localFunction({bool b: false}) {} | 2474 void localFunction({bool b: false}) {} |
2475 } | 2475 } |
2476 | 2476 |
2477 void functionWithGenericFunctionTypedParam/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) {} | 2477 void functionWithGenericFunctionTypedParam/*<S>*/(/*=T*/ pf/*<T>*/(/*=T*/ e)) {} |
| 2478 void functionWithClosureAsDefaultParam([x = () => null]) {} |
2478 '''); | 2479 '''); |
2479 context.resolveCompilationUnit2(source, source); | 2480 context.resolveCompilationUnit2(source, source); |
2480 LibraryElement firstElement = context.computeLibraryElement(source); | 2481 LibraryElement firstElement = context.computeLibraryElement(source); |
2481 _ElementGatherer gatherer = new _ElementGatherer(); | 2482 _ElementGatherer gatherer = new _ElementGatherer(); |
2482 firstElement.accept(gatherer); | 2483 firstElement.accept(gatherer); |
2483 | 2484 |
2484 CacheEntry entry = | 2485 CacheEntry entry = |
2485 context.analysisCache.get(new LibrarySpecificUnit(source, source)); | 2486 context.analysisCache.get(new LibrarySpecificUnit(source, source)); |
2486 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); | 2487 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); |
2487 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); | 2488 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); |
(...skipping 2800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5288 * Initialize the visitor. | 5289 * Initialize the visitor. |
5289 */ | 5290 */ |
5290 _ElementGatherer(); | 5291 _ElementGatherer(); |
5291 | 5292 |
5292 @override | 5293 @override |
5293 void visitElement(Element element) { | 5294 void visitElement(Element element) { |
5294 elements[element] = element; | 5295 elements[element] = element; |
5295 super.visitElement(element); | 5296 super.visitElement(element); |
5296 } | 5297 } |
5297 } | 5298 } |
OLD | NEW |