fails on regular expressions with Unicode property escapes
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 30/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- javascript, wasm
- 領域
- tooling
研究方向
使用回報的命令 bunx jco componentize world.js --wit wit -o ts-typescript.wasm -d clocks -d random -d http 重現失敗,並檢查 node_modules/.pnpm/[email protected]/node_modules/change-case/dist/index.js 中的 Unicode 屬性正規表示式。透過 src/componentize.js 第 305 行附近以及回報的 jco 進入點追蹤該失敗。完成的標準是相同的輸入可以在沒有 Wizer 初始化錯誤的情況下被 componentize。
由索引模型根據 Issue 內容生成。
描述
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/[email protected]/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.
- 主要語言
- Rust
- 星號
- 395
- 分支
- 57
- 平均合併
- 2 天 18 小時
- 30 天內合併 PR
- 3
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
bytecodealliance/ComponentizeJS 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
-
enhancement
難度 4/5 3-5 天 新手友好度 56/100
-
難度 3/5 1-2 天 新手友好度 52/100
-
難度 4/5 3-5 天 新手友好度 45/100
-
難度 4/5 3-5 天 新手友好度 48/100
bytecodealliance/ComponentizeJS#335 · 3 則留言 ·
查看 bytecodealliance/ComponentizeJS 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 62/100
NuSkooler/enigma-bbs#907 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
EasyTier/EasyTier#2672 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 84/100
repowise-dev/repowise#3374 ·
維護者通常 1 天內回覆