fails on regular expressions with Unicode property escapes
Chưa có ai nhận issue này.
Đá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
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, wasm
- Lĩnh vực
- tooling
Hướng nghiên cứu
Tái hiện lỗi bằng lệnh đã báo cáo bunx jco componentize world.js --wit wit -o ts-typescript.wasm -d clocks -d random -d http và kiểm tra các biểu thức chính quy thuộc tính Unicode trong node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js. Theo dõi lỗi qua src/componentize.js quanh dòng 305 và các điểm vào jco đã báo cáo. Hoàn thành khi cùng một đầu vào có thể được componentize mà không gặp lỗi khởi tạo Wizer.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am trying to wrap typespec into a component. It pulls in change-case library which uses regular expressions with Unicode. componetize is failing on these regular expressions:
var SPLIT_LOWER_UPPER_RE = /([\p{Ll}\d])(\p{Lu})/gu;
var SPLIT_UPPER_UPPER_RE = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
var SPLIT_SEPARATE_NUMBER_RE = /(\d)\p{Ll}|(\p{L})\d/u;
var DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
The code is from here:
node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.js
https://www.npmjs.com/package/change-case
https://github.com/blakeembrey/change-case/blob/main/packages/change-case/src/index.ts
$ bunx jco componentize world.js --wit wit -o ts-typescript.wasm -d clocks -d random -d http
Exception while evaluating top-level script
world.js:31083:32 SyntaxError: invalid class property name in regular expression:
world.js:31083:32 ([\p{Ll}\d])(\p{Lu})
world.js:31083:32 ....^
Error: the `componentize.wizer` function trapped
Caused by:
0: error while executing at wasm backtrace:
0: 0x79597a - <unknown>!<wasm function 12739>
1: 0x7962ed - <unknown>!<wasm function 12755>
2: 0x20646 - <unknown>!<wasm function 98>
3: 0x1f5f9 - <unknown>!<wasm function 96>
4: 0xa6a5 - <unknown>!<wasm function 78>
5: 0x22acba - <unknown>!<wasm function 5037>
1: Exited with i32 exit status 1
Error: Failed to initialize the compiled Wasm binary with Wizer:
Wizering failed to complete
at componentize (file:///Users/cataggar/ms/ComponentizeJS/src/componentize.js:305:13)
at async componentize (file:///Users/cataggar/ms/jco/src/cmd/componentize.js:11:25)
at async file:///Users/cataggar/ms/jco/src/jco.js:213:9
error: script "componentize" exited with code 1
(jco componentize)
In 'typescript' script 'componentize' failed with exit code 1
Copilot says:
SpiderMonkey, the JavaScript and WebAssembly engine used in Mozilla Firefox, supports Unicode property escapes as part of the ECMAScript 2018 (ES9) specification. This feature allows you to use Unicode property escapes in regular expressions to match characters based on their Unicode properties.
Enabling Unicode Property Escapes in SpiderMonkey
To ensure that SpiderMonkey is compiled with support for Unicode property escapes, you need to use a version of SpiderMonkey that supports ECMAScript 2018 or later. Most modern versions of SpiderMonkey, including those used in recent versions of Firefox, already include this support.
- Ngôn ngữ chính
- Rust
- Star
- 392
- Fork
- 54
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 bytecodealliance/ComponentizeJS
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
bytecodealliance/ComponentizeJS#335 · 3 bình luận ·
Tất cả issue của bytecodealliance/ComponentizeJS
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
state:needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
zed-industries/zed#64680 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
RustPython/RustPython#8802 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
TheLarkInn/aipm#2390 ·