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

Side by Side Diff: pkg/fletchc/lib/src/class_debug_info.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
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.md file.
4
5 library fletchc.class_debug_info;
6
7 import 'package:compiler/src/elements/elements.dart';
8
9 import '../fletch_system.dart';
10
11 class ClassDebugInfo {
12 final FletchClass klass;
13 List<String> fieldNames;
14
15 ClassDebugInfo(FletchClass klass)
16 : this.klass = klass,
17 fieldNames = _computeFieldNames(klass);
18
19 static _computeFieldNames(FletchClass klass) {
20 int localFields = klass.fields.length - klass.superclassFields;
21 List fieldNames = new List(localFields);
22 int index = 0;
23 ClassElement classElement = klass.element.implementation;
24 String className = classElement.name != null ? '${classElement.name}.' : '';
25 classElement.forEachInstanceField((_, FieldElement field) {
26 fieldNames[index++] = '$className${field.name}';
27 });
28 assert(index == localFields);
29 return fieldNames;
30 }
31 }
OLDNEW
« no previous file with comments | « pkg/fletchc/lib/src/bytecode_assembler.dart ('k') | pkg/fletchc/lib/src/closure_environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698