| OLD | NEW |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 /// This is the formal parameter scope as specified in the Dart Programming | 65 /// This is the formal parameter scope as specified in the Dart Programming |
| 66 /// Language Specifiction, 4th ed, section 9.2. | 66 /// Language Specifiction, 4th ed, section 9.2. |
| 67 Scope computeFormalParameterScope(Scope parent) { | 67 Scope computeFormalParameterScope(Scope parent) { |
| 68 if (formals == null) return parent; | 68 if (formals == null) return parent; |
| 69 Map<String, Builder> local = <String, Builder>{}; | 69 Map<String, Builder> local = <String, Builder>{}; |
| 70 for (FormalParameterBuilder formal in formals) { | 70 for (FormalParameterBuilder formal in formals) { |
| 71 if (!isConstructor || !formal.hasThis) { | 71 if (!isConstructor || !formal.hasThis) { |
| 72 local[formal.name] = formal; | 72 local[formal.name] = formal; |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 return new Scope(local, parent, isModifiable: false); | 75 return new Scope(local, null, parent, isModifiable: false); |
| 76 } | 76 } |
| 77 | 77 |
| 78 /// This scope doesn't correspond to any scope specified in the Dart | 78 /// This scope doesn't correspond to any scope specified in the Dart |
| 79 /// Programming Language Specifiction, 4th ed. It's an unspecified extension | 79 /// Programming Language Specifiction, 4th ed. It's an unspecified extension |
| 80 /// to support generic methods. | 80 /// to support generic methods. |
| 81 Scope computeTypeParameterScope(Scope parent) { | 81 Scope computeTypeParameterScope(Scope parent) { |
| 82 if (typeVariables == null) return parent; | 82 if (typeVariables == null) return parent; |
| 83 Map<String, Builder> local = <String, Builder>{}; | 83 Map<String, Builder> local = <String, Builder>{}; |
| 84 for (TypeVariableBuilder variable in typeVariables) { | 84 for (TypeVariableBuilder variable in typeVariables) { |
| 85 local[variable.name] = variable; | 85 local[variable.name] = variable; |
| 86 } | 86 } |
| 87 return new Scope(local, parent, isModifiable: false); | 87 return new Scope(local, null, parent, isModifiable: false); |
| 88 } | 88 } |
| 89 } | 89 } |
| OLD | NEW |