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

Side by Side Diff: tests/compiler/dart2js/resolver_test.dart

Issue 11783089: Fix VariableDefinitions.endToken for formal parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
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 17 matching lines...) Expand all
28 for (final variable in variables) { 28 for (final variable in variables) {
29 String name = variable[0]; 29 String name = variable[0];
30 bool init = variable[1]; 30 bool init = variable[1];
31 if (init) { 31 if (init) {
32 locals.add(buildInitialization(name)); 32 locals.add(buildInitialization(name));
33 } else { 33 } else {
34 locals.add(buildIdentifier(name)); 34 locals.add(buildIdentifier(name));
35 } 35 }
36 } 36 }
37 var definitions = new NodeList(null, new Link.fromList(locals), null, null); 37 var definitions = new NodeList(null, new Link.fromList(locals), null, null);
38 return new VariableDefinitions(null, Modifiers.EMPTY, definitions, null); 38 return new VariableDefinitions(null, Modifiers.EMPTY, definitions);
39 } 39 }
40 40
41 testLocals(List variables) { 41 testLocals(List variables) {
42 MockCompiler compiler = new MockCompiler(); 42 MockCompiler compiler = new MockCompiler();
43 ResolverVisitor visitor = compiler.resolverVisitor(); 43 ResolverVisitor visitor = compiler.resolverVisitor();
44 Element element = visitor.visit(createLocals(variables)); 44 Element element = visitor.visit(createLocals(variables));
45 // A VariableDefinitions does not have an element. 45 // A VariableDefinitions does not have an element.
46 Expect.equals(null, element); 46 Expect.equals(null, element);
47 Expect.equals(variables.length, map(visitor).length); 47 Expect.equals(variables.length, map(visitor).length);
48 48
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 var d = new D(); 842 var d = new D();
843 --d; 843 --d;
844 }"""; 844 }""";
845 final compiler = compileScript(script); 845 final compiler = compileScript(script);
846 846
847 checkMemberResolved(compiler, 'A', operatorName('+', false)); 847 checkMemberResolved(compiler, 'A', operatorName('+', false));
848 checkMemberResolved(compiler, 'B', operatorName('+', false)); 848 checkMemberResolved(compiler, 'B', operatorName('+', false));
849 checkMemberResolved(compiler, 'C', operatorName('-', false)); 849 checkMemberResolved(compiler, 'C', operatorName('-', false));
850 checkMemberResolved(compiler, 'D', operatorName('-', false)); 850 checkMemberResolved(compiler, 'D', operatorName('-', false));
851 } 851 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/tree/unparser.dart ('k') | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698