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

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

Issue 2727313004: Recover correctly from this-parameter on non-constructors. (Closed)
Patch Set: Update status files. Created 3 years, 9 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 | tests/co19/co19-kernel.status » ('j') | 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.procedure_builder; 5 library fasta.procedure_builder;
6 6
7 // Note: we're deliberately using AsyncMarker and ProcedureKind from kernel 7 // Note: we're deliberately using AsyncMarker and ProcedureKind from kernel
8 // outside the kernel-specific builders. This is simpler than creating 8 // outside the kernel-specific builders. This is simpler than creating
9 // additional enums. 9 // additional enums.
10 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; 10 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 bool get isFactory => identical(ProcedureKind.Factory, kind); 62 bool get isFactory => identical(ProcedureKind.Factory, kind);
63 63
64 void set body(covariant statement); 64 void set body(covariant statement);
65 65
66 /// This is the formal parameter scope as specified in the Dart Programming 66 /// This is the formal parameter scope as specified in the Dart Programming
67 /// Language Specifiction, 4th ed, section 9.2. 67 /// Language Specifiction, 4th ed, section 9.2.
68 Scope computeFormalParameterScope(Scope parent) { 68 Scope computeFormalParameterScope(Scope parent) {
69 if (formals == null) return parent; 69 if (formals == null) return parent;
70 Map<String, Builder> local = <String, Builder>{}; 70 Map<String, Builder> local = <String, Builder>{};
71 for (FormalParameterBuilder formal in formals) { 71 for (FormalParameterBuilder formal in formals) {
72 if (!formal.hasThis) { 72 if (!isConstructor || !formal.hasThis) {
73 local[formal.name] = formal; 73 local[formal.name] = formal;
74 } 74 }
75 } 75 }
76 return new Scope(local, parent, isModifiable: false); 76 return new Scope(local, parent, isModifiable: false);
77 } 77 }
78 78
79 /// This scope doesn't correspond to any scope specified in the Dart 79 /// This scope doesn't correspond to any scope specified in the Dart
80 /// Programming Language Specifiction, 4th ed. It's an unspecified extension 80 /// Programming Language Specifiction, 4th ed. It's an unspecified extension
81 /// to support generic methods. 81 /// to support generic methods.
82 Scope computeTypeParameterScope(Scope parent) { 82 Scope computeTypeParameterScope(Scope parent) {
83 if (typeVariables == null) return parent; 83 if (typeVariables == null) return parent;
84 Map<String, Builder> local = <String, Builder>{}; 84 Map<String, Builder> local = <String, Builder>{};
85 for (TypeVariableBuilder variable in typeVariables) { 85 for (TypeVariableBuilder variable in typeVariables) {
86 local[variable.name] = variable; 86 local[variable.name] = variable;
87 } 87 }
88 return new Scope(local, parent, isModifiable: false); 88 return new Scope(local, parent, isModifiable: false);
89 } 89 }
90 } 90 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698