fix(native): order Objective-C category records

This commit is contained in:
morluto committed 2026-10-27 12:27:32 +08:00
1 parent f5edef3c96
commit 21f12b896e
2 files changed
+25

No files matched your search

@@ -91,6 +91,29 @@ describe("symbol-only Objective-C implementation identity", () => {
"category",
);
});
it("orders distinct category identities independently of provider inventory order", () => {
const names = [
"-[StoreController(Actions) buildTapped:]",
"-[StoreController(OtherActions) buildTapped:]",
];
const inspect = (ordered: string[]) =>
inspectNativeDispatchMetadata(
ordered.map((name) => ({ address: "0x1000", name })),
ordered.length,
);
const forward = inspect(names);
const reverse = inspect([...names].reverse());
expect(reverse).toEqual(forward);
expect(
reverse.objc_dispatch_implementations.map(({ category }) => category),
).toEqual(["Actions", "OtherActions"]);
expect(
reverse.objc_dispatch_implementations.map(({ evidence }) =>
evidence.map(({ description }) => description),
),
).toEqual(names.map((name) => [`Provider symbol ${name}`]));
});
});
describe("symbol-only Objective-C implementation addresses", () => {
+2
View File
@@ -646,12 +646,14 @@ export const inspectNativeDispatchMetadata = (
left.selector,
left.method_type,
left.implementation_address ?? "",
left.category ?? null,
]),
compositeKey([
right.class_name,
right.selector,
right.method_type,
right.implementation_address ?? "",
right.category ?? null,
]),
),
);