mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 11:13:21 +00:00
fix(native): order Objective-C category records
This commit is contained in:
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", () => {
|
||||
|
||||
@@ -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,
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user