Compiler 0.3.1 silently changes "\n" to "n" in string literals
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 70/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- compilers
调研方向
Start by locating the string literal parsing and code generation entry points in the compiler, then reproduce with the provided repro.rx and compile.mjs example using @reactivescript/[email protected]. Check how the \n escape is represented through compilation; done means the generated separator evaluates to U+000A and the issue's reproduction no longer changes the split result.
由索引模型根据 Issue 内容生成。
描述
With @reactivescript/[email protected], compiling a newline separator changes its meaning without reporting a diagnostic.
Reproduction
Install the compiler in a Node.js project:
npm install --save-exact @reactivescript/[email protected]
Create repro.rx:
source text := ""
export default component Probe() {
lines = text.split("\n")
<pre>{lines.length}</pre>
}
Create compile.mjs and run node compile.mjs:
import { app } from "@reactivescript/compiler";
import { resolve } from "node:path";
const result = JSON.parse(app(resolve("repro.rx"), "dom"));
if (!result.modules) {
throw new Error(JSON.stringify(result));
}
for (const module of Object.values(result.modules)) {
console.log(module.code);
}
Actual output
The generated computation contains:
const v$lines = __rt.memo("lines", (__prev) => v$text()?.split("n"), undefined);
The separator is the letter n (U+006E), rather than a newline (U+000A). Compilation succeeds without reporting a diagnostic.
Expected behavior
The generated separator should evaluate to U+000A, preserving the semantics of .split("\n").
For example, given the JavaScript string "first\nsecond":
// Expected
["first", "second"]
// Actual with the generated separator
["first\nseco", "d"]
Impact
This caused incorrect rendering of single-line error summaries in an application. Diagnosing it required inspecting the generated JavaScript. Moving the string processing into an imported TypeScript helper worked around the issue.
Environment
@reactivescript/compiler:0.3.1- Target:
dom - Node.js:
v24.14.1 - Platform: macOS, arm64
Reproduced again on November 15, 2026. Confirmed for \n; other escape sequences have not been tested.
- 主要语言
- TypeScript
- 星标
- 127
- 派生
- 7
- 平均合并
- 15 小时 42 分钟
- 30 天内合并 PR
- 63
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
solidjs/reactivescript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
solidjs/reactivescript#96 ·
维护者通常 1 天内回复
-
Vite front end keeps serving a failed build after the missing/broken imported module is fixed可能已有人在做 @cgaaf 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
solidjs/reactivescript#84 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
solidjs/reactivescript#77 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
solidjs/reactivescript#74 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 62/100
solidjs/reactivescript#97 ·
维护者通常 1 天内回复
查看 solidjs/reactivescript 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
GetStream/stream-chat-react#3467 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
vercel-labs/ui#1139 ·
维护者通常 1 天内回复
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10可能已有人在做 @goranai 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bot:ai-assisted component:platform-js status:untriaged
难度 2/5 1-3 小时 新手友好度 82/100
midnightntwrk/platform-js#93 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100