Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[TS] Evaluate instanceof against the runtime constructor value

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

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
kotlin, node.js, typescript

調査の方向性

Start at the current instanceof evaluator and its use of the static EtsIR checkType, then review the focused symbolic-test entry point described in the issue. Account for dependencies JacoDB #390 and UnitTestBot/jacodb#396 before testing. Done means both outcomes share one static RHS type, direct checks remain covered, and generated inputs and results replay in Node.js.

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

説明

enhancement

Problem

The current instanceof evaluator uses the static checkType from EtsIR. For a dynamic right-hand side, that type does not identify which constructor object the program actually selected. JacoDB PR #395 therefore marks dynamic checks unsupported instead of reporting a possibly false Boolean.

Minimal TypeScript example

class A {}
class B {}
export function check(useA: boolean): boolean {
  const ctor = useA ? A : B;
  return new A() instanceof ctor;
}

Node.js returns true for check(true) and false for check(false). The ctor expression must be evaluated once; the membership check must use that runtime value, not its static union type.

Expected support

Use the right-hand constructor value and the left-hand object's prototype chain for the supported class-constructor model. Preserve JavaScript behavior for a non-callable RHS (TypeError) where that value is representable. If custom Symbol.hasInstance is outside the current model, report that case as unsupported explicitly.

Acceptance criteria

  • A focused symbolic test obtains both outcomes with the same static RHS type and distinguishes unsupported from failure.
  • Generated inputs and results replay in Node.js.
  • Direct value instanceof A remains covered and correct.

Dependencies: JacoDB #390 (RHS evaluation) and UnitTestBot/jacodb#396 (declared class runtime values). Implement this as a separate USVM PR.

主要言語
Kotlin
スター
33
フォーク
27
平均マージ
3日 8時間
マージ済み PR(30日)
7

環境構築

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

はじめの一歩

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

UnitTestBot/usvm のほかの issue

UnitTestBot/usvm の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

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

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