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

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

Issue 3010763002: Fix for ScopeBuilder[] - look into setters too. (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.scope; 5 library fasta.scope;
6 6
7 import 'builder/builder.dart' show Builder, TypeVariableBuilder; 7 import 'builder/builder.dart' show Builder, TypeVariableBuilder;
8 8
9 import 'fasta_codes.dart' 9 import 'fasta_codes.dart'
10 show 10 show
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 ScopeBuilder(this.scope); 273 ScopeBuilder(this.scope);
274 274
275 void addMember(String name, Builder builder) { 275 void addMember(String name, Builder builder) {
276 scope.local[name] = builder; 276 scope.local[name] = builder;
277 } 277 }
278 278
279 void addSetter(String name, Builder builder) { 279 void addSetter(String name, Builder builder) {
280 scope.setters[name] = builder; 280 scope.setters[name] = builder;
281 } 281 }
282 282
283 Builder operator [](String name) => scope.local[name]; 283 Builder operator [](String name) {
284 return scope.local[name] ?? scope.setters[name];
285 }
284 } 286 }
285 287
286 abstract class ProblemBuilder extends Builder { 288 abstract class ProblemBuilder extends Builder {
287 final String name; 289 final String name;
288 290
289 final Builder builder; 291 final Builder builder;
290 292
291 ProblemBuilder(this.name, this.builder, int charOffset, Uri fileUri) 293 ProblemBuilder(this.name, this.builder, int charOffset, Uri fileUri)
292 : super(null, charOffset, fileUri); 294 : super(null, charOffset, fileUri);
293 295
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 333
332 Message get message => templateAccessError.withArguments(name); 334 Message get message => templateAccessError.withArguments(name);
333 } 335 }
334 336
335 class AmbiguousBuilder extends ProblemBuilder { 337 class AmbiguousBuilder extends ProblemBuilder {
336 AmbiguousBuilder(String name, Builder builder, int charOffset, Uri fileUri) 338 AmbiguousBuilder(String name, Builder builder, int charOffset, Uri fileUri)
337 : super(name, builder, charOffset, fileUri); 339 : super(name, builder, charOffset, fileUri);
338 340
339 Message get message => templateDuplicatedName.withArguments(name); 341 Message get message => templateDuplicatedName.withArguments(name);
340 } 342 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698