x/y/z bindings not restored when a function body throws

オープン
#9 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@tangentstorm がすでに取り組んでいます。

2026年10月29日 から。

  • #13 @tangentstorm による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
typescript
領域
compilers

調査の方向性

Read imp-eval.mts around line 495, where the saved x, y, and z bindings are restored after function evaluation. Reproduce the reported sequence (x: 10, f: {x + bad}, then f[99]) and check the value of x after catching the error. Done means the original bindings remain intact after a function body throws; an open linked pull request already addresses this issue.

索引モデルが issue の本文から書いたものです。

説明

approved follow-up

From the Codex whole-repo review on #5 (review comment).

Location: imp-eval.mts:495 on main (6813323)

[P2] Restore parameter bindings when a function body throws

If lastEval throws, execution skips restoration of the saved x, y, and z bindings, leaving function arguments in the shared word dictionary. In separate evaluations, x: 10, f: {x + bad}, and f[99] demonstrate this: after catching the undefined-word error, evaluating x returns 99 rather than 10. Since the REPL and MCP worker catch evaluation errors and continue using that dictionary, a failed call silently corrupts subsequent program state. Restore the bindings in a finally block.

Checked 2026-10-29: still present on main; not touched by open PRs #3, #4 or #7.

主要言語
TypeScript
スター
6
フォーク
1
平均マージ
3分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tangentcode/implish のほかの issue

tangentcode/implish の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。