b6e3c5cffd
When serializing JS, we can sometimes end up changing the order we visit ModularExpressions. This can mean their indices are not stable against serialization and so the emitted code (and as a result hashes for that code) can change if the compiler did any serializing during the compilation. We can make the order stable by sorting the holders before we process them. This removes diff in hashes when running this (`--test-mode` forces serialization): ``` out/ReleaseX64/dart-sdk/bin/dart compile js benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart --out=om1a/m.js out/ReleaseX64/dart-sdk/bin/dart compile js benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart --test-mode --out=om1b/m.js ``` Bug: https://github.com/dart-lang/sdk/issues/53466 Change-Id: Ibec88ff6acb71f1e96cbdb1d5ef4200d370cc3c6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325100 Commit-Queue: Nate Biggs <natebiggs@google.com> Reviewed-by: Stephen Adams <sra@google.com>