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

Side by Side Diff: pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart

Issue 2788913002: Prepare for separate setter scope. (Closed)
Patch Set: Address comments. Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.constructor_reference_builder; 5 library fasta.constructor_reference_builder;
6 6
7 import 'builder.dart' 7 import 'builder.dart'
8 show Builder, ClassBuilder, PrefixBuilder, Scope, TypeBuilder; 8 show Builder, ClassBuilder, PrefixBuilder, Scope, TypeBuilder;
9 9
10 import '../messages.dart' show warning; 10 import '../messages.dart' show warning;
(...skipping 18 matching lines...) Expand all
29 int index = name.indexOf("."); 29 int index = name.indexOf(".");
30 Builder builder; 30 Builder builder;
31 if (index == -1) { 31 if (index == -1) {
32 builder = scope.lookup(name, charOffset, fileUri); 32 builder = scope.lookup(name, charOffset, fileUri);
33 } else { 33 } else {
34 String prefix = name.substring(0, index); 34 String prefix = name.substring(0, index);
35 String middle = name.substring(index + 1); 35 String middle = name.substring(index + 1);
36 builder = scope.lookup(prefix, charOffset, fileUri); 36 builder = scope.lookup(prefix, charOffset, fileUri);
37 if (builder is PrefixBuilder) { 37 if (builder is PrefixBuilder) {
38 PrefixBuilder prefix = builder; 38 PrefixBuilder prefix = builder;
39 builder = prefix.exports[middle]; 39 builder = prefix.lookup(middle, charOffset, fileUri);
40 } else if (builder is ClassBuilder) { 40 } else if (builder is ClassBuilder) {
41 ClassBuilder cls = builder; 41 ClassBuilder cls = builder;
42 builder = cls.constructors[middle]; 42 builder = cls.findConstructorOrFactory(middle, charOffset, fileUri);
43 if (suffix == null) { 43 if (suffix == null) {
44 target = builder; 44 target = builder;
45 return; 45 return;
46 } 46 }
47 } 47 }
48 } 48 }
49 if (builder is ClassBuilder) { 49 if (builder is ClassBuilder) {
50 target = builder.constructors[suffix ?? ""]; 50 target =
51 builder.findConstructorOrFactory(suffix ?? "", charOffset, fileUri);
51 } 52 }
52 if (target == null) { 53 if (target == null) {
53 warning(null, -1, "Couldn't find constructor '$fullNameForErrors'."); 54 warning(fileUri, charOffset,
55 "Couldn't find constructor '$fullNameForErrors'.");
54 } 56 }
55 } 57 }
56 } 58 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/class_builder.dart ('k') | pkg/front_end/lib/src/fasta/builder/library_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698