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

Unified Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 2072223002: Enforce use of the forEachInstanceField ordering for constructed constants. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove tab Created 4 years, 6 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
Index: pkg/compiler/lib/src/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 9d86752a40b6e076b2500118701ebfc43a4ff986..475ba6f73dc9dd87513f6e797f8b4e89b82b67da 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -1735,10 +1735,10 @@ class ConstantNamingVisitor implements ConstantValueVisitor {
@override
void visitConstructed(ConstructedConstantValue constant, [_]) {
addRoot(constant.type.element.name);
- for (ConstantValue value in constant.fields.values) {
- _visit(value);
+ constant.type.element.forEachInstanceField((_, FieldElement field) {
if (failed) return;
- }
+ _visit(constant.fields[field]);
+ }, includeSuperAndInjectedMembers: true);
}
@override
@@ -1862,9 +1862,9 @@ class ConstantCanonicalHasher implements ConstantValueVisitor<int, Null> {
@override
int visitConstructed(ConstructedConstantValue constant, [_]) {
int hash = _hashString(3, constant.type.element.name);
- for (ConstantValue value in constant.fields.values) {
- hash = _combine(hash, _visit(value));
- }
+ constant.type.element.forEachInstanceField((_, FieldElement field) {
+ hash = _combine(hash, _visit(constant.fields[field]));
+ }, includeSuperAndInjectedMembers: true);
return hash;
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_system_javascript.dart ('k') | tests/language/const_constructor_super2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698