fix: integrate 14 approved fix PRs (668,671,673,675,678-681,685-690) (#705)
* fix(javascript): preserve array index positions Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(javascript): respect object property overwrite order Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * test(javascript): cover uncertain spread discriminants Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(javascript): keep nonfinite values outside JSON lattice Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(dotnet): keep non-CIL method implementations unknown Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * test(package): separate CIL reconstruction from native imports Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(javascript): invalidate values on nontrivial binding writes Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(artifacts): align native DMG mount and detach lifecycle Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(browser): retain all literal worker import arguments Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(native): preserve final demangled symbol whitespace Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(dotnet): preserve C identifier underscores in native matching Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(browser): respect metadata key and overwrite semantics Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(javascript): keep optional parameter input unknown Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(dotnet): report observed method metadata changes Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * docs(dotnet): synchronize generated conformance skill digest Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(browser): reject malformed indexed source-map offsets Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * fix(native): preserve numeric-looking Mach-O identifiers Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> * docs: regenerate catalogs for integrated fix batch * docs: regenerate catalogs after merging main (#702) --------- Signed-off-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com> Co-authored-by: RudyCelekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { expect, it } from "vitest";
|
||||
import { parseDemangledSymbols } from "./demangle.js";
|
||||
|
||||
it.each(["ordinary name ", "ordinary\t", " "])(
|
||||
"preserves unchanged final symbol text: %j",
|
||||
(input) => {
|
||||
expect(parseDemangledSymbols([input], `${input}\n`)).toEqual([
|
||||
{ input, output: input, status: "unchanged" },
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
it("removes only the line terminator and preserves mixed output ordering", () => {
|
||||
expect(
|
||||
parseDemangledSymbols(
|
||||
["$s4main5helloyyF", "plain "],
|
||||
"main.hello() -> ()\r\nplain \r\n",
|
||||
),
|
||||
).toEqual([
|
||||
{
|
||||
input: "$s4main5helloyyF",
|
||||
output: "main.hello() -> ()",
|
||||
status: "demangled",
|
||||
},
|
||||
{ input: "plain ", output: "plain ", status: "unchanged" },
|
||||
]);
|
||||
});
|
||||
@@ -11,7 +11,7 @@ export const parseDemangledSymbols = (
|
||||
inputs: readonly string[],
|
||||
output: string,
|
||||
) => {
|
||||
const lines = output.trimEnd().split(/\r?\n/u);
|
||||
const lines = output.replace(/\r?\n$/u, "").split(/\r?\n/u);
|
||||
if (lines.length !== inputs.length)
|
||||
throw new TypeError("swift-demangle output count does not match input");
|
||||
return inputs.map((input, index) => {
|
||||
|
||||
@@ -219,7 +219,10 @@ const parseFields = (block: string): Record<string, string | number | null> => {
|
||||
const match = /^((?:time stamp)|\S+(?:\s+version)?)\s+(.+)$/u.exec(line);
|
||||
if (match?.[1] === undefined || match[2] === undefined) continue;
|
||||
const value = match[2].trim();
|
||||
fields[match[1]] = numeric(value) ?? value;
|
||||
fields[match[1]] =
|
||||
match[1] === "segname" || match[1] === "sectname"
|
||||
? value
|
||||
: (numeric(value) ?? value);
|
||||
}
|
||||
return fields;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user