| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 mock_compiler; | 5 library mock_compiler; |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 | 10 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 return resolveNodeStatement(parsedTree, mainApp); | 406 return resolveNodeStatement(parsedTree, mainApp); |
| 407 } | 407 } |
| 408 | 408 |
| 409 TreeElementMapping resolveNodeStatement(Node tree, Element element) { | 409 TreeElementMapping resolveNodeStatement(Node tree, Element element) { |
| 410 ResolverVisitor visitor = | 410 ResolverVisitor visitor = |
| 411 new ResolverVisitor(this, element, new CollectingTreeElements(element)); | 411 new ResolverVisitor(this, element, new CollectingTreeElements(element)); |
| 412 if (visitor.scope is LibraryScope) { | 412 if (visitor.scope is LibraryScope) { |
| 413 visitor.scope = new MethodScope(visitor.scope, element); | 413 visitor.scope = new MethodScope(visitor.scope, element); |
| 414 } | 414 } |
| 415 visitor.visit(tree); | 415 visitor.visit(tree); |
| 416 visitor.scope = new LibraryScope(element.getLibrary()); | 416 visitor.scope = new LibraryScope(element.library); |
| 417 return visitor.mapping; | 417 return visitor.mapping; |
| 418 } | 418 } |
| 419 | 419 |
| 420 resolverVisitor() { | 420 resolverVisitor() { |
| 421 Element mockElement = | 421 Element mockElement = |
| 422 new FunctionElementX('', ElementKind.FUNCTION, Modifiers.EMPTY, | 422 new FunctionElementX('', ElementKind.FUNCTION, Modifiers.EMPTY, |
| 423 mainApp.entryCompilationUnit, false); | 423 mainApp.entryCompilationUnit, false); |
| 424 ResolverVisitor visitor = | 424 ResolverVisitor visitor = |
| 425 new ResolverVisitor(this, mockElement, | 425 new ResolverVisitor(this, mockElement, |
| 426 new CollectingTreeElements(mockElement)); | 426 new CollectingTreeElements(mockElement)); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 } else { | 580 } else { |
| 581 sourceFile = compiler.sourceFiles[uri.toString()]; | 581 sourceFile = compiler.sourceFiles[uri.toString()]; |
| 582 } | 582 } |
| 583 if (sourceFile != null && begin != null && end != null) { | 583 if (sourceFile != null && begin != null && end != null) { |
| 584 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 584 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
| 585 } else { | 585 } else { |
| 586 print(message); | 586 print(message); |
| 587 } | 587 } |
| 588 }; | 588 }; |
| 589 } | 589 } |
| OLD | NEW |