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

Unified Diff: pkg/compiler/lib/src/js_model/locals.dart

Issue 3000233002: Remove KernelToLocalsMap.getLocalFunction (Closed)
Patch Set: Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | pkg/compiler/lib/src/kernel/element_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_model/locals.dart
diff --git a/pkg/compiler/lib/src/js_model/locals.dart b/pkg/compiler/lib/src/js_model/locals.dart
index 92686b37c328385ccf962feb44afae3bc5e5a345..dcb8d949ad4c1ceacab0e0bf7078df510ff95913 100644
--- a/pkg/compiler/lib/src/js_model/locals.dart
+++ b/pkg/compiler/lib/src/js_model/locals.dart
@@ -25,7 +25,7 @@ class GlobalLocalsMap {
class KernelToLocalsMapImpl implements KernelToLocalsMap {
final List<MemberEntity> _members = <MemberEntity>[];
- Map<ir.TreeNode, JLocal> _map = <ir.TreeNode, JLocal>{};
+ Map<ir.VariableDeclaration, JLocal> _map = <ir.VariableDeclaration, JLocal>{};
Map<ir.TreeNode, JJumpTarget> _jumpTargetMap;
Set<ir.BreakStatement> _breaksAsContinue;
@@ -142,28 +142,6 @@ class KernelToLocalsMapImpl implements KernelToLocalsMap {
}
@override
- // TODO(johnniwinther): Split this out into two methods -- one for
- // FunctionDeclaration and one for FunctionExpression, since basically the
- // whole thing is different depending on the node type. The reason it's not
- // done yet is the version of this function that it's overriding has a little
- // bit of commonality.
- Local getLocalFunction(ir.TreeNode node) {
- assert(node is ir.FunctionDeclaration || node is ir.FunctionExpression,
- failedAt(currentMember, 'Invalid local function node: $node'));
- var lookupName = node;
- if (node is ir.FunctionDeclaration) lookupName = node.variable;
- return _map.putIfAbsent(lookupName, () {
- String name;
- if (node is ir.FunctionDeclaration) {
- name = node.variable.name;
- } else if (node is ir.FunctionExpression) {
- name = '';
- }
- return new JLocal(name, currentMember);
- });
- }
-
- @override
CapturedLoopScope getCapturedLoopScope(
ClosureDataLookup closureLookup, ir.TreeNode node) {
return closureLookup.getCapturedLoopScope(node);
« no previous file with comments | « pkg/compiler/lib/src/js_model/closure.dart ('k') | pkg/compiler/lib/src/kernel/element_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698