Gap capture: an optional call's short-circuit record can pair with another evaluation (four cases)

未關閉
#162 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
javascript
領域
testing-qa

研究方向

Start with pr147-review.md at “Delta round 2”, D1, then read the gap oracle’s Limits and the simulations in /tmp/rev147-scripts/q2.mjs and q3.mjs. The issue describes four record pairing failures and states that fixing them may require a statement level rewrite or another design. Done means choosing and implementing a design that prevents those failures; no tests or source files are named.

由索引模型根據 Issue 內容生成。

描述

#147 makes an optional call f?.() pass its short-circuit on to the next ?. link of its chain:

  • the link's receiver opens a record (open);
  • the call's empty argument spread marks the newest open record as run (ran), and it runs only when the call does;
  • the link reads the newest record and closes it (chain).

The records of one call site form a stack, so a record pairs with its evaluation only where evaluations of the same expression nest and each one ends. The oracles repo has no coverage map, so this issue records the four cases that break the pairing. Each needs an owner. No history of the gap oracle generates any of them, and the gap oracle's Limits state them.

# Case Record left behind Consequence for the next ?. link
1 An evaluation of the same expression nested in the receiver, which throws after its call ran, and the throw is caught there run, left open With the outer method absent: a false infection, and a false throw under the link's mutant (P3)
2 The same nesting in the method lookup run, left open The same: a false throw (P3)
3 An evaluation nested in the call's arguments or the method's body, which throws before its own call runs, and the throw is caught there not run, left open With the outer call having run and returned nothing: a false skip, so the mutant is judged without a run as not-distinguished. This is the class of #109 (P5)
4 Two async evaluations of the same expression interleaved at an await ((await r(a))?.f?.(await g())?.v) the evaluations close each other's records a false skip or a false throw

The review that found them is pr147-review.md, "Delta round 2", D1. The simulations are in /tmp/rev147-scripts/q2.mjs and q3.mjs.

A pairing per evaluation would need a binding that an expression rewrite cannot create without changing this, await or arguments. For example, an arrow wrapper breaks await and yield. A fix would need a statement-level rewrite or another design.

The numeric path for nested ?. links (shortCircuited) is not affected. Nothing runs between a link that short-circuits and its consumer.

Filed under v21.2 P11 and G36, as a stated limit with an owner.

This issue was written by Isaac.

主要語言
JavaScript
星號
5
分支
1
平均合併
11 小時 18 分鐘
30 天內合併 PR
66

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TanStack/oracles 的其他 Issue

查看 TanStack/oracles 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。