дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
Application regex lookbehind prevented older WebKit from loading the startup module graph. Replace lookbehind with boundary checks across run/terminal links, SQL aliases, debugger targets and refactoring; preserve Unicode boundaries, UTF-16 offsets and empty-match progress. Add compatibility and regression tests. Fixes #224 Refs #208
18 рядки
757 B
TypeScript
18 рядки
757 B
TypeScript
// @vitest-environment node
|
|
import { readdirSync, readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
import { expect, it } from "vitest";
|
|
|
|
it("keeps application regexes parseable in pre-16.4 WebKit", () => {
|
|
const root = resolve(import.meta.dirname, "../..");
|
|
const offenders: string[] = [];
|
|
for (const dir of ["src", "public"]) {
|
|
for (const file of readdirSync(resolve(root, dir), { recursive: true, encoding: "utf8" })) {
|
|
if (!/\.[cm]?[jt]sx?$/.test(file) || /\.test\.[jt]sx?$/.test(file)) continue;
|
|
const source = readFileSync(resolve(root, dir, file), "utf8");
|
|
if (source.includes("(?<" + "=") || source.includes("(?<" + "!")) offenders.push(`${dir}/${file}`);
|
|
}
|
|
}
|
|
expect(offenders).toEqual([]);
|
|
});
|