Repository navigation
Conversation
Test262 conformance changes
Fixed tests (2):Tested main commit: |
`export default AssignmentExpression` names an anonymous function definition through NamedEvaluation, so a class gets the name "default" inside ClassDefinitionEvaluation, before its static elements are defined, and a static `name` method replaces it. The bytecompiler instead called SetFunctionName on the finished value, which overwrote such a method. Name the expression in the parser, as every other NamedEvaluation site does, and drop the late SetFunctionName.
IamYipi
force-pushed
the
fix/default-export-class-name
branch
from
October 7, 2026 08:23
8382ab6 to
eff4a46
Compare
Contributor
Author
|
Rebased on main: the Lint failure came from the Rust 1.99 clippy lints that #5552 fixed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5544 +/- ##
===========================================
+ Coverage 47.24% 63.02% +15.77%
===========================================
Files 476 536 +60
Lines 46892 60309 +13417
===========================================
+ Hits 22154 38007 +15853
+ Misses 24738 22302 -2436 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
This Pull Request fixes the name of an anonymous class exported with
export default AssignmentExpressionwhen the class has a staticnamemethod.export default AssignmentExpression ;evaluates an anonymous function definition with NamedEvaluation and the argument"default". For a class, ClassDefinitionEvaluation calls SetFunctionName(F, "default") before it defines the static elements, so a staticnamemethod replaces the name. Boa compiled the expression first and then emittedSetFunctionNameon the finished class, which overwrote the method.It changes the following:
defaultwithset_anonymous_function_definition_name, as it already does for every other NamedEvaluation site (variable declarations, assignments, property definitions, class fields). The name is then in place when the class is compiled.SetFunctionNameforDefaultAssignmentExpression. The step comments now follow the spec.test_default_export_named_evaluationtocore/engine/tests/module.rs. It checks that anonymous functions, arrow functions and classes are still nameddefault, and that a staticnamemethod replaces the name.Test262 results for the full suite, compared with
mainusingboa_tester compare: 2 tests fixed, no regressions.cargo fmt --all --checkis clean. So iscargo clippy -p boa_parser -p boa_engine --all-features --all-targetswith-D warnings.