Valid legacy regex fragments are rejected before native compilation
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js, typescript
- Lĩnh vực
- compilers, testing-qa
Hướng nghiên cứu
Start by saving the reduced example as fragment.mjs and comparing scriptc's diagnostic with Node 24.22.1. Trace the regex literal diagnostic path and the TypeScript diagnostic boundary mentioned in the issue; cover fragment composition, legacy escapes, capture references, replacements, and invalid Unicode patterns. Compare native output with Node, including sanitized execution; done means valid legacy fragments compile while invalid u and v patterns still reject. An open linked pull request (#3041) is already addressing this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
We are compiling the full Sentry CLI with scriptc, including its existing dependencies. highlight.js builds a Perl grammar by taking the source of a legacy regular-expression fragment and inserting it into a larger pattern. The fragment is valid JavaScript, but the build stops with SC0001 before it reaches the native regex runtime.
A reduced example is:
console.log(new RegExp("(a)" + /\1/.source).test("aa"));
Save this as fragment.mjs. Node 24.22.1 prints true. Building it with scriptc built from current main reports that the backreference refers to a group that does not exist (TypeScript TS1534). The related literal /(a)\2/ reaches TS1533 instead.
These non-Unicode literals have defined legacy semantics. Their source can also be reused in a pattern with enough capture groups, as in the example. The standalone literal and the final constructed pattern are different expressions and should each keep their JavaScript behavior.
Expected behavior is to compile valid legacy fragments and match Node. Regexes with u or v must still reject invalid backreferences. This should not be fixed by discarding all regex grammar diagnostics or changing the fragment's source text.
Regression coverage should include fragment composition, standalone octal and identity escapes, real capture references and replacement, invalid Unicode patterns, and the existing TypeScript diagnostic boundary. Native output needs to be compared with Node, including sanitized execution.
This removes one observed blocker from the CLI bundle; it does not establish that the whole CLI compiles. I rechecked open issues and PRs before filing this. The RegExp call handling in #2928 addresses a different lowering path, rather than these literal diagnostics.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.5k
- Fork
- 212
- Merge trung bình
- 13 giờ 6 phút
- Pull request đã merge (30 ngày)
- 799
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vercel-labs/scriptc
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
vercel-labs/scriptc#3416 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
vercel-labs/scriptc#3415 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
readline: named stdin/stdout imports not recognized as createInterface input/outputCó thể đã có người làm @espetro đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@types/node collides with scriptc-node-fallback.d.ts in projects without tsconfig.jsonCó thể đã có người làm @espetro đã nhận hôm nay. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 20/100
vercel-labs/scriptc#3413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
island: ESM module with 'module.exports' named export loses its default export across the boundaryCó thể đã có người làm @espetro đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
vercel-labs/scriptc#3412 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel-labs/scriptc
Issue tương tự
-
Recording drops clicks on links, filters and checkboxes that share a form with a search fieldCó thể đã có người làm @columbia11 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tencent/BrowserSkill#657 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Choosing a folder while continuing an Antigravity session submits a history fork the runtime rejectsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
-
ai-handle
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nextlevelbuilder/dewee-web-v2#138 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NEARBuilders/citynode.app#512 ·
Maintainer thường phản hồi trong vòng 1 ngày