[codex] Implement computed property names#3694
Draft
andrewtdiz wants to merge 1 commit into
Draft
Conversation
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
Closes #3581.
Closes #3557.
Closes #3558.
Closes #3559.
Closes #3560.
Closes #3561.
Implements computed property names end to end across object literals, class methods/accessors, and object-literal
superdispatch.Root Cause
Computed keys were lowered through several special-case paths that did not consistently perform ECMAScript
ToPropertyKeyconversion. That lost symbols, stringified numeric/object keys inconsistently, and evaluated class/object members outside source order. Computed class methods were also sometimes treated like per-instance fields, so duplicate overwrite semantics and static/class symbol dispatch diverged from JavaScript.What Changed
ToPropertyKeypath.this, and object-literalsuper.superhelpers that resolve through the current home-object prototype, including afterObject.setPrototypeOf..constructorvalues so Test262assert.throws(TypeError, ...)can verify the new static computed"prototype"TypeError cases.Validation
cargo test -p perry-runtime property_keycargo test -p perry-hir -p perry-codegen -p perry-runtime -- --test-threads=1cargo build --release -p perry -p perry-runtime -p perry-stdlibtest-files/test_issue_3557_computed_class_methods.tstest-files/test_issue_3558_computed_accessors.tstest-files/test_issue_3559_computed_key_side_effect_order.tstest-files/test_issue_3560_object_super_computed_members.tstest-files/test_issue_3561_object_literal_computed_keys.ts4249661388e5d3f92a85186213da140a6481490f:scripts/test262_subset.py --root vendor/test262 --dir language/computed-property-names --sample-cap 99999 --report /tmp/perry-test262-computed-final2.jsonpass=48 diff=0 runtime-fail=0 compile-fail=0 skip=0 parity=100%Notes
The existing untracked DeepWiki reference at
reference/was left unstaged.