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

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

Issue 3004433002: Encapsulate the index based maps for entities. (Closed)
Patch Set: Updated cf. comments Created 3 years, 3 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 | « no previous file | pkg/compiler/lib/src/js_model/elements.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/closure.dart
diff --git a/pkg/compiler/lib/src/js_model/closure.dart b/pkg/compiler/lib/src/js_model/closure.dart
index 0d9a9df1764227379ffeda3a30605821a994d4bf..297238e0708476aa061e28a243474fbf9122e89f 100644
--- a/pkg/compiler/lib/src/js_model/closure.dart
+++ b/pkg/compiler/lib/src/js_model/closure.dart
@@ -426,8 +426,8 @@ class NodeBox {
}
class JClosureClass extends JClass {
- JClosureClass(JLibrary library, int classIndex, String name)
- : super(library, classIndex, name, isAbstract: false);
+ JClosureClass(JLibrary library, String name)
+ : super(library, name, isAbstract: false);
@override
bool get isClosure => true;
@@ -436,10 +436,9 @@ class JClosureClass extends JClass {
}
class JClosureField extends JField {
- JClosureField(String name, int memberIndex,
- KernelClosureClass containingClass, bool isConst, bool isAssignable)
+ JClosureField(String name, KernelClosureClass containingClass, bool isConst,
+ bool isAssignable)
: super(
- memberIndex,
containingClass.closureClassEntity.library,
containingClass.closureClassEntity,
new Name(name, containingClass.closureClassEntity.library),
@@ -452,17 +451,9 @@ class JClosureField extends JField {
/// elsewhere.
// TODO(efortuna, johnniwinther): Don't implement JClass. This isn't actually a
// class.
-class JRecord implements JClass {
- final JLibrary library;
- final String name;
-
- /// Index into the classData, classList and classEnvironment lists where this
- /// entity is stored in [JsToFrontendMapImpl].
- final int classIndex;
-
- JRecord(this.library, this.classIndex, this.name);
-
- bool get isAbstract => false;
+class JRecord extends JClass {
+ JRecord(LibraryEntity library, String name)
+ : super(library, name, isAbstract: false);
bool get isClosure => false;
@@ -476,9 +467,8 @@ class JRecord implements JClass {
/// algorithm to correspond to the actual name of the variable.
class JRecordField extends JField {
final BoxLocal box;
- JRecordField(String name, int memberIndex, this.box, JClass containingClass,
- bool isConst)
- : super(memberIndex, containingClass.library, containingClass,
+ JRecordField(String name, this.box, JClass containingClass, bool isConst)
+ : super(containingClass.library, containingClass,
new Name(name, containingClass.library),
isStatic: false, isAssignable: true, isConst: isConst);
}
« 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