mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-04 08:04:37 +08:00
`value instanceof Boolean` (or Number, String, BigInt, Symbol) died at run time in JavaScript with Node's TypeError for a function without a prototype object, because those constructors are compiled as plain conversion closures; in TypeScript the right-hand side was refused (SC1090). A compiled program never creates a boxed primitive (`new Boolean(...)` has no lowering) and a primitive is never an instance, so the test is false for every value. It now folds to false after evaluating the operand. typebox's value guards (IsBoolean, IsNumber, IsString) test this way, so pi's tool-schema construction and validation died at its first guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>