Admit object spread computed property keys - #3017
Merged
rogeralsing merged 1 commit intoJun 1, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands unified-bytecode production support for computed property keys by allowing certain object literal spans (including object spreads) to be compiled as part of the computed-key “payload”, and ensures the unified-bytecode compiler correctly threads string constants so object literal property names can be emitted safely in that context.
Changes:
- Allow admitted simple object-literal spans (including spread-only) inside computed property key spans for production eligibility and compilation.
- Thread
stringConstantsthrough computed property key span compilation and stage/commit string constants in boundary compilation paths that can now emit object literals. - Update tests to validate the unified-bytecode production fast-path is used (instead of asserting fallback) and adjust eligibility expectations accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionInvocationTests.cs | Replaces a fallback-based test with a fast-path assertion for computed keys that use spread-only object literals. |
| tests/Asynkron.JsEngine.Tests/UnifiedBytecodeProductionEligibilityTests.cs | Updates expected decline code to reflect new eligibility and improves assertion diagnostics. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeProductionEligibility.cs | Relaxes eligibility rules to admit object spreads in computed-key payloads when they’re part of admitted object literal spans; adds support for CreateObject in computed-key span measurement. |
| src/Asynkron.JsEngine/Execution/UnifiedBytecode/UnifiedBytecodeCompiler.cs | Extends computed property key span compilation to emit simple object literal spans (including spreads) and stages/threads string constants so object literal property names are correctly recorded. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
UnifiedBytecodeProductionEligibilityTests.Evaluate_PropertyReadAdjacentFamilies_DeclineWithExplicitCodes|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedPropertyReadWithSpreadObjectKey_UsesUnifiedBytecodeProductionFastPath|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ObjectLiteralSpread_UsesUnifiedBytecodeProductionFastPathAndCopiesSymbolKeys|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ObjectLiteralConstruction_UsesUnifiedBytecodeProductionFastPathAndCoercesComputedKeys|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests.ComputedPropertyReadWithOrdinaryDynamicKey_UsesUnifiedBytecodeProductionFastPath'\n- rtk dotnet test tests/Asynkron.JsEngine.Tests -c Release --filter 'FullyQualifiedNameUnifiedBytecodeProductionEligibilityTests|FullyQualifiedNameUnifiedBytecodeProductionInvocationTests|FullyQualifiedNameUnifiedBytecodeProductionSpreadCallTests|FullyQualifiedNameUnifiedBytecodeProductionConstructCallTests|FullyQualifiedNameExpressionProgramLoweringTests|FullyQualifiedNameExpressionProgramCoverageMapTests|FullyQualifiedNameAstFreeExecutionAssertionTests'\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