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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1873823002: Update elements, nodes and visitors for serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 4 years, 8 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/elements/elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 7483034919e09fe58ed2410f5caacceb23464e1a..e9d184537a00b13cbc03b1fe5f58118f5d0b10e2 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -3179,11 +3179,12 @@ class IrBuilderVisitor extends ast.Visitor<ir.Primitive>
/// Lookup the value of the enum described by [node].
getEnumValue(ast.Node node, EnumClassElement enumClass, List values) {
Element element = elements[node];
- if (element is! FieldElement || element.enclosingClass != enumClass) {
+ if (element is! EnumConstantElement ||
+ element.enclosingClass != enumClass) {
internalError(node, 'expected a JsBuiltin enum value');
}
-
- int index = enumClass.enumValues.indexOf(element);
+ EnumConstantElement enumConstant = element;
+ int index = enumConstant.index;
return values[index];
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698