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

Side by Side Diff: pkg/compiler/lib/src/js_model/closure_visitors.dart

Issue 2975513003: Fix js_model/model_test (Closed)
Patch Set: Created 3 years, 5 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 | pkg/compiler/lib/src/js_model/elements.dart » ('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) 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:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../elements/entities.dart'; 8 import '../elements/entities.dart';
9 import '../kernel/element_map.dart';
9 import 'closure.dart'; 10 import 'closure.dart';
10 import '../kernel/element_map.dart';
11 11
12 /// This builder walks the code to determine what variables are captured/free at 12 /// This builder walks the code to determine what variables are captured/free at
13 /// various points to build ClosureScope that can respond to queries 13 /// various points to build ClosureScope that can respond to queries
14 /// about how a particular variable is being used at any point in the code. 14 /// about how a particular variable is being used at any point in the code.
15 class ClosureScopeBuilder extends ir.Visitor { 15 class ClosureScopeBuilder extends ir.Visitor {
16 /// A map of each visited call node with the associated information about what 16 /// A map of each visited call node with the associated information about what
17 /// variables are captured/used. Each ir.Node key corresponds to a scope that 17 /// variables are captured/used. Each ir.Node key corresponds to a scope that
18 /// was encountered while visiting a closure (initially called through 18 /// was encountered while visiting a closure (initially called through
19 /// [translateLazyIntializer] or [translateConstructorOrProcedure]). 19 /// [translateLazyIntializer] or [translateConstructorOrProcedure]).
20 Map<ir.Node, ClosureScope> _closureInfoMap = <ir.Node, ClosureScope>{}; 20 Map<ir.Node, ClosureScope> _closureInfoMap = <ir.Node, ClosureScope>{};
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 nodeToConvert.isInstanceMember)) { 285 nodeToConvert.isInstanceMember)) {
286 return new ThisLocal(_kernelToElementMap.getConstructor(nodeToConvert)); 286 return new ThisLocal(_kernelToElementMap.getConstructor(nodeToConvert));
287 } else if (nodeToConvert is ir.Procedure && 287 } else if (nodeToConvert is ir.Procedure &&
288 nodeToConvert.isInstanceMember) { 288 nodeToConvert.isInstanceMember) {
289 return new ThisLocal(_kernelToElementMap.getMethod(nodeToConvert)); 289 return new ThisLocal(_kernelToElementMap.getMethod(nodeToConvert));
290 } 290 }
291 } 291 }
292 return null; 292 return null;
293 } 293 }
294 } 294 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_model/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698