| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 | 7 |
| 8 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution
.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution
.dart"; |
| 9 import "compiler_helper.dart"; | 9 import "compiler_helper.dart"; |
| 10 import "parser_helper.dart"; | 10 import "parser_helper.dart"; |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 at(Link link, int index) => (index == 0) ? link.head : at(link.tail, index - 1); | 777 at(Link link, int index) => (index == 0) ? link.head : at(link.tail, index - 1); |
| 778 | 778 |
| 779 List<String> asSortedStrings(Link link) { | 779 List<String> asSortedStrings(Link link) { |
| 780 List<String> result = <String>[]; | 780 List<String> result = <String>[]; |
| 781 for (; !link.isEmpty; link = link.tail) result.add(link.head.toString()); | 781 for (; !link.isEmpty; link = link.tail) result.add(link.head.toString()); |
| 782 result.sort((s1, s2) => s1.compareTo(s2)); | 782 result.sort((s1, s2) => s1.compareTo(s2)); |
| 783 return result; | 783 return result; |
| 784 } | 784 } |
| 785 | 785 |
| 786 compileScript(String source) { | 786 compileScript(String source) { |
| 787 Uri uri = new Uri.fromComponents(scheme: 'source'); | 787 Uri uri = new Uri(scheme: 'source'); |
| 788 MockCompiler compiler = compilerFor(source, uri); | 788 MockCompiler compiler = compilerFor(source, uri); |
| 789 compiler.runCompiler(uri); | 789 compiler.runCompiler(uri); |
| 790 return compiler; | 790 return compiler; |
| 791 } | 791 } |
| 792 | 792 |
| 793 checkMemberResolved(compiler, className, memberName) { | 793 checkMemberResolved(compiler, className, memberName) { |
| 794 Element memberElement = findElement(compiler, className) | 794 Element memberElement = findElement(compiler, className) |
| 795 .lookupLocalMember(memberName); | 795 .lookupLocalMember(memberName); |
| 796 Expect.isNotNull(memberElement); | 796 Expect.isNotNull(memberElement); |
| 797 Expect.isNotNull( | 797 Expect.isNotNull( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 var d = new D(); | 838 var d = new D(); |
| 839 --d; | 839 --d; |
| 840 }"""; | 840 }"""; |
| 841 final compiler = compileScript(script); | 841 final compiler = compileScript(script); |
| 842 | 842 |
| 843 checkMemberResolved(compiler, 'A', operatorName('+', false)); | 843 checkMemberResolved(compiler, 'A', operatorName('+', false)); |
| 844 checkMemberResolved(compiler, 'B', operatorName('+', false)); | 844 checkMemberResolved(compiler, 'B', operatorName('+', false)); |
| 845 checkMemberResolved(compiler, 'C', operatorName('-', false)); | 845 checkMemberResolved(compiler, 'C', operatorName('-', false)); |
| 846 checkMemberResolved(compiler, 'D', operatorName('-', false)); | 846 checkMemberResolved(compiler, 'D', operatorName('-', false)); |
| 847 } | 847 } |
| OLD | NEW |