fix(interp): collapse drifted boxed EvaluateGetOnRecord onto the RV implementation#1267
Merged
Conversation
…mplementation
The boxed copy had drifted from EvaluateGetOnRecordRV: its __proto__
walk only continued through SharpTSObject prototypes, so a property
living on a SharpTSInstance prototype (Object.create(new Point())-style
chains) resolved to undefined for boxed callers — named ESM imports
from CJS modules, CJS re-exports, and for-of iterator-protocol reads.
It also still dispatched getters via legacy .Call instead of CallV2.
The boxed method is now a one-line .ToObject() adapter over the RV
implementation (RuntimeValue.ToObject maps Undefined back to the
SharpTSUndefined.Instance sentinel the old copy returned).
Repro fixed: point.cjs with 'module.exports = Object.create(new
Point())' + 'import { x } from "./point.cjs"' — was undefined, now
reads the instance field.
Verified: full suite 15452/0; Test262 interpreter baseline diff clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One of the fix-first duplication findings from the 2026-07-01 audit (re-verified today):
EvaluateGetOnRecord(boxed) andEvaluateGetOnRecordRVwere a ~68-line near-duplicate that had already drifted — the boxed__proto__walk stopped at aSharpTSInstanceprototype and dispatched getters via legacy.Call, while the RV loop handles the instance arm and usesCallV2.Observable bug fixed
Boxed callers are the named-CJS-import interop reads (
Interpreter.csimport/re-export paths) and the for-of iterator-protocoldone/valuereads. With a CJS module whose exports object isObject.create(new Point()):Change
The boxed method is now a one-line
.ToObject()adapter overEvaluateGetOnRecordRV(−65 lines;RuntimeValue.ToObjectmapsUndefinedback to theSharpTSUndefined.Instancesentinel, so miss behavior is identical). Rationale docs moved onto the RV method, which is now the single implementation.Verification
undefined, post-fix42), plus a for-of protocol sanity checkbuilt-ins/Object, property-accessors — no regressions, no unexpected new-passes)