[pkg/vm_snapshot_analysis] Allow old 'patched_class_' field.

While in more recent SDK versions the 'patched_class_' field has
been replaced with 'wrapped_class_', this package can still be
used with the earlier SDK versions if we fall back to checking it.

Issue: https://github.com/flutter/flutter/issues/130009
Change-Id: Ifb1250393b72e58bbdc0764c7e2ce96269e659ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312802
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Tess Strickland 2023-07-07 11:36:59 +00:00 committed by Commit Queue
parent 1133598168
commit 1bdbafff49
3 changed files with 10 additions and 2 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 0.7.6
- Allow the old `'patched_class_'` field for `PatchClass` until we change the
SDK lower bound for this package to a version that does not have it.
## 0.7.5
- Fix for flutter/flutter#130009 where an attempt to lookup the owner info

View file

@ -440,7 +440,10 @@ class _ProgramInfoBuilder {
type: NodeType.functionNode);
case 'PatchClass':
return getInfoNodeFor(node['wrapped_class_']!);
// Allow the old patched_class_ field if the wrapped_class_ field does
//not exist.
final wrappedClass = node['wrapped_class_'] ?? node['patched_class_']!;
return getInfoNodeFor(wrappedClass);
case 'Class':
// Default to root node. Some builtin classes (void, dynamic) don't have

View file

@ -1,5 +1,5 @@
name: vm_snapshot_analysis
version: 0.7.5
version: 0.7.6
description: Utilities for analysing AOT snapshot size.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/vm_snapshot_analysis