Admit ternary property-read operands - #3023
Merged
rogeralsing merged 1 commit intoJun 1, 2026
Merged
Conversation
rogeralsing
deleted the
codex/unified-bytecode-loop-63-conditional-property-operands
branch
June 1, 2026 22:32
There was a problem hiding this comment.
Pull request overview
This PR expands the unified-bytecode production eligibility rules to allow activation-resolved, non-optional, non-private named property reads (e.g., this.flag, this.value) within ternary (cond ? a : b) expression programs, and updates the test/proof surface accordingly.
Changes:
- Update production-eligibility logic to admit certain
GetNamedPropertyoperands when the expression program contains a ternary (JumpIfConditionalFalse). - Replace the prior “declines” eligibility test with an “accepts” test for
this.flag ? this.a : other, and add a runtime fast-path invocation test forthis.flag ? this.value : other. - Refresh the unified bytecode expansion contract proof command to point at the updated eligibility test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Adds an invocation test asserting ternary with this.* property reads uses the production fast path. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Converts the prior decline test into an acceptance test for ternary property-read operands. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Adds a new eligibility “admit” shape for activation-resolved named property reads in conditional-expression programs. |
| docs/unified-bytecode-expansion-contract.md | Updates the proof command reference for the prototype-guard:JumpIfFalse row. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1911
to
+1914
| if (FindFirstOperation(program, ExpressionOpKind.JumpIfConditionalFalse) < 0) | ||
| { | ||
| return false; | ||
| } |
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.
Summary
this.flag ? this.value : otherproperty-read boundary decline into route coverageVerification
rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests.Evaluate_ConditionalExpression_ThisPropertyConditionAndArms_Accepts|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.Ternary_ThisPropertyConditionAndArm_UsesProductionFastPath|FullyQualifiedName~ExpressionProgramLoweringTests.ObjectSpreadLiteral_SpreadOnlyShape_MatchesJavaScriptBehavior|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests.CallWithObjectLiteralArg_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedName~ExpressionProgramCoverageMapTests.UnifiedBytecodeExpansionContract_ListsRequiredHeadingsAndCurrentEnums'\n-rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedName~UnifiedBytecodeProductionEligibilityTests|FullyQualifiedName~UnifiedBytecodeProductionInvocationTests|FullyQualifiedName~UnifiedBytecodeProductionSpreadCallTests|FullyQualifiedName~UnifiedBytecodeProductionConstructCallTests|FullyQualifiedName~ExpressionProgramLoweringTests|FullyQualifiedName~ExpressionProgramCoverageMapTests|FullyQualifiedName~AstFreeExecutionAssertionTests'\n-rtk dotnet build src/Asynkron.JsEngine/Asynkron.JsEngine.csproj -c Release\n-rtk rg "EvaluateExpression\\(|ProfileEvaluateExpression\\(" src/Asynkron.JsEngine/Ast/TypedAstEvaluator.ExecutionPlanRunner*\n-rtk git diff --check