Admit declaration destructuring descriptors - #3029
Merged
rogeralsing merged 1 commit intoJun 1, 2026
Merged
Conversation
rogeralsing
deleted the
codex/unified-bytecode-loop-69-destructuring-descriptors
branch
June 1, 2026 23:13
There was a problem hiding this comment.
Pull request overview
This PR expands production unified-bytecode routing to admit declaration destructuring shapes that include defaults and computed binding names by routing them through ApplyDeclarationBindingTarget, and updates tests/docs to reflect the new eligibility and route-hit behavior.
Changes:
- Routes declaration destructuring defaults/computed binding names through
ApplyDeclarationBindingTargetand removes now-redundant eligibility/compiler filters. - Updates eligibility tests to expect acceptance (and presence of
ApplyDeclarationBindingTargetplus binding-target constants). - Updates invocation tests and contract documentation to treat these shapes as production-fast-path hits rather than fallbacks.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Converts declaration destructuring default/computed cases to assert production fast-path route-hit logging. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Updates expectations to accept descriptor opcode (ApplyDeclarationBindingTarget) and require binding-target constants for these destructuring shapes. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Removes duplicate/obsolete declaration binding-target destructuring eligibility filter. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Removes duplicate/obsolete declaration binding-target compilation filter, allowing descriptor opcode usage. |
| docs/unified-bytecode-expansion-contract.md | Updates the DestructuringDependency contract row to reflect the newly admitted declaration destructuring descriptor-backed lane and test filter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
408
to
418
| if (instruction is BindingVariableDeclarationInstruction | ||
| { | ||
| VarKind: VariableKind.Using or VariableKind.AwaitUsing | ||
| }) | ||
| { | ||
| declineCode = UnifiedBytecodeProductionDeclineCode.UnsupportedPlanShape; | ||
| declineReason = "using declarations require scope-exit disposal and are not eligible for production unified bytecode routing."; | ||
| return true; | ||
| } | ||
|
|
||
| if (instruction is BindingVariableDeclarationInstruction bindingDeclaration && | ||
| !IsSupportedDeclarationBindingTarget(bindingDeclaration.TargetProgram)) | ||
| { | ||
| declineCode = UnifiedBytecodeProductionDeclineCode.DestructuringDependency; | ||
| declineReason = | ||
| "Binding/destructuring declarations with defaults, computed names, or assignment targets are not eligible for production unified bytecode routing."; | ||
| return true; | ||
| } | ||
|
|
||
| if (instruction is FunctionDeclarationInstruction { Descriptor: not null }) |
Comment on lines
891
to
897
| case BindingVariableDeclarationInstruction | ||
| { | ||
| AwaitedProgram: null | ||
| } declaration: | ||
| if (!IsSupportedDeclarationBindingTarget(declaration.TargetProgram)) | ||
| { | ||
| reason = | ||
| "Binding declaration targets with defaults, computed names, or assignment targets are not eligible for unified bytecode storage."; | ||
| return false; | ||
| } | ||
|
|
||
| var hasBindingInitializer = declaration.InitializerProgram is not null; | ||
| if (declaration.InitializerProgram is { } bindingInitializerProgram) | ||
| { |
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
Verification