| 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 'dart:collection'; | 5 import 'dart:collection'; |
| 6 import 'dart:uri'; | 6 import 'dart:uri'; |
| 7 | 7 |
| 8 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution
.dart"; | 8 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution
.dart"; |
| 9 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; | 9 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar
t"; |
| 10 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; | 10 import "../../../sdk/lib/_internal/compiler/implementation/tree/tree.dart"; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 for (final variable in variables) { | 27 for (final variable in variables) { |
| 28 String name = variable[0]; | 28 String name = variable[0]; |
| 29 bool init = variable[1]; | 29 bool init = variable[1]; |
| 30 if (init) { | 30 if (init) { |
| 31 locals.add(buildInitialization(name)); | 31 locals.add(buildInitialization(name)); |
| 32 } else { | 32 } else { |
| 33 locals.add(buildIdentifier(name)); | 33 locals.add(buildIdentifier(name)); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 var definitions = new NodeList(null, new Link.fromList(locals), null, null); | 36 var definitions = new NodeList(null, new Link.fromList(locals), null, null); |
| 37 return new VariableDefinitions(null, Modifiers.EMPTY, definitions); | 37 return new VariableDefinitions(null, Modifiers.EMPTY, definitions, null); |
| 38 } | 38 } |
| 39 | 39 |
| 40 testLocals(List variables) { | 40 testLocals(List variables) { |
| 41 MockCompiler compiler = new MockCompiler(); | 41 MockCompiler compiler = new MockCompiler(); |
| 42 ResolverVisitor visitor = compiler.resolverVisitor(); | 42 ResolverVisitor visitor = compiler.resolverVisitor(); |
| 43 Element element = visitor.visit(createLocals(variables)); | 43 Element element = visitor.visit(createLocals(variables)); |
| 44 // A VariableDefinitions does not have an element. | 44 // A VariableDefinitions does not have an element. |
| 45 Expect.equals(null, element); | 45 Expect.equals(null, element); |
| 46 Expect.equals(variables.length, map(visitor).length); | 46 Expect.equals(variables.length, map(visitor).length); |
| 47 | 47 |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 var d = new D(); | 840 var d = new D(); |
| 841 --d; | 841 --d; |
| 842 }"""; | 842 }"""; |
| 843 final compiler = compileScript(script); | 843 final compiler = compileScript(script); |
| 844 | 844 |
| 845 checkMemberResolved(compiler, 'A', operatorName('+', false)); | 845 checkMemberResolved(compiler, 'A', operatorName('+', false)); |
| 846 checkMemberResolved(compiler, 'B', operatorName('+', false)); | 846 checkMemberResolved(compiler, 'B', operatorName('+', false)); |
| 847 checkMemberResolved(compiler, 'C', operatorName('-', false)); | 847 checkMemberResolved(compiler, 'C', operatorName('-', false)); |
| 848 checkMemberResolved(compiler, 'D', operatorName('-', false)); | 848 checkMemberResolved(compiler, 'D', operatorName('-', false)); |
| 849 } | 849 } |
| OLD | NEW |