Файли
openidea/src/platform/webkitCompatibility.test.ts
T
l0ng-ai d37b96002b fix: avoid lookbehind in application regexes for older WebKit
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
2026-10-29 15:01:01 +08:00

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([]);
});