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

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

Issue 2877253003: Don't type promote local functions. (Closed)
Patch Set: Created 3 years, 7 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 'package:front_end/src/fasta/kernel/utils.dart'; 5 import 'package:front_end/src/fasta/kernel/utils.dart';
6 import 'package:front_end/src/fasta/scanner/token.dart' show Token; 6 import 'package:front_end/src/fasta/scanner/token.dart' show Token;
7 import 'package:front_end/src/fasta/type_inference/type_promotion.dart'; 7 import 'package:front_end/src/fasta/type_inference/type_promotion.dart';
8 import 'package:kernel/ast.dart'; 8 import 'package:kernel/ast.dart';
9 9
10 import '../builder/ast_factory.dart'; 10 import '../builder/ast_factory.dart';
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return new KernelTypeLiteral(type); 234 return new KernelTypeLiteral(type);
235 } 235 }
236 236
237 @override 237 @override
238 VariableDeclaration variableDeclaration( 238 VariableDeclaration variableDeclaration(
239 String name, Token token, int functionNestingLevel, 239 String name, Token token, int functionNestingLevel,
240 {DartType type, 240 {DartType type,
241 Expression initializer, 241 Expression initializer,
242 Token equalsToken, 242 Token equalsToken,
243 bool isFinal: false, 243 bool isFinal: false,
244 bool isConst: false}) { 244 bool isConst: false,
245 bool isLocalFunction: false}) {
245 return new KernelVariableDeclaration(name, functionNestingLevel, 246 return new KernelVariableDeclaration(name, functionNestingLevel,
246 type: type, 247 type: type,
247 initializer: initializer, 248 initializer: initializer,
248 isFinal: isFinal, 249 isFinal: isFinal,
249 isConst: isConst) 250 isConst: isConst,
251 isLocalFunction: isLocalFunction)
250 ..fileOffset = offsetForToken(token) 252 ..fileOffset = offsetForToken(token)
251 ..fileEqualsOffset = offsetForToken(equalsToken); 253 ..fileEqualsOffset = offsetForToken(equalsToken);
252 } 254 }
253 255
254 @override 256 @override
255 VariableGet variableGet( 257 VariableGet variableGet(
256 VariableDeclaration variable, 258 VariableDeclaration variable,
257 TypePromotionFact<VariableDeclaration> fact, 259 TypePromotionFact<VariableDeclaration> fact,
258 TypePromotionScope scope, 260 TypePromotionScope scope,
259 Token token) { 261 Token token) {
260 return new KernelVariableGet(variable, fact, scope) 262 return new KernelVariableGet(variable, fact, scope)
261 ..fileOffset = offsetForToken(token); 263 ..fileOffset = offsetForToken(token);
262 } 264 }
263 265
264 @override 266 @override
265 VariableSet variableSet(VariableDeclaration variable, Expression value) { 267 VariableSet variableSet(VariableDeclaration variable, Expression value) {
266 return new KernelVariableSet(variable, value); 268 return new KernelVariableSet(variable, value);
267 } 269 }
268 } 270 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698