Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly resolve paths in SimpleModuleLoader and add path to Referrer::Script #3791

Merged
merged 9 commits into from
Apr 5, 2024

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Apr 4, 2024

We do have the path in parsed Script (if the Source has it), so use that if we can.

Fixes #3790.

@hansl
Copy link
Contributor Author

hansl commented Apr 4, 2024

Note: This should fix many test262 that were broken by the last changes to SimpleModuleLoader, but it won't fix all of them. That is because some of those tests were false positive and the code is not behaving properly. I filed a bug regarding one of those newly failing test. I will have to investigate if there are more.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 73.68421% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 50.23%. Comparing base (6ddc2b4) to head (56f3cde).
Report is 120 commits behind head on main.

Files Patch % Lines
core/engine/src/module/loader.rs 78.12% 7 Missing ⚠️
core/engine/src/script.rs 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3791      +/-   ##
==========================================
+ Coverage   47.24%   50.23%   +2.98%     
==========================================
  Files         476      456      -20     
  Lines       46892    44816    -2076     
==========================================
+ Hits        22154    22513     +359     
+ Misses      24738    22303    -2435     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jedel1043
Copy link
Member

Test262 conformance changes

Test result main count PR count difference
Total 50,268 50,268 0
Passed 42,773 42,753 -20
Ignored 1,391 1,391 0
Failed 6,104 6,124 +20
Panics 18 18 0
Conformance 85.09% 85.05% -0.04%
Broken tests (20):
test/language/expressions/dynamic-import/for-await-resolution-and-error-agen-yield.js (previously Passed)
test/language/expressions/dynamic-import/custom-primitive.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/yield-assign-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/yield-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/call-expr-identifier.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/logical-or-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/logical-and-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/lhs-assign-operator-assign-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/cover-call-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/additive-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/member-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/ternary.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/await-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/call-expr-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/call-expr-arguments.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/array-literal.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/object-literal.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/cover-parenthesized-expr.js (previously Passed)
test/language/expressions/dynamic-import/assignment-expression/identifier.js (previously Passed)

@jedel1043
Copy link
Member

jedel1043 commented Apr 4, 2024

By the way, this doesn't print a nice comment because the action doesn't work on forks. If you want to see the test count, you can check it on the test262 action:
https://github.com/boa-dev/boa/actions/runs/8562670896/job/23466338447?pr=3791

Specifically on the input of the "Write a new comment" task.

@jedel1043
Copy link
Member

Fixed the remaining tests. This now just needs some small fixes on the tests and docs.

@hansl
Copy link
Contributor Author

hansl commented Apr 5, 2024

Apparently the definition of absolute path is different on Windows. Will fix tomorrow.

Also confirming that (at least locally) the test262 results are the same after the latest commit on this PR as before my SimpleModuleLoader change:

CleanShot 2024-04-04 at 19 25 07@2x

@jedel1043 jedel1043 requested a review from a team April 5, 2024 18:59
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work!

@jedel1043 jedel1043 requested a review from a team April 5, 2024 19:00
Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! :)

Comment on lines +36 to +47
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Boa (Tester)",
"windows": {
"program": "${workspaceFolder}/target/debug/boa_tester.exe"
},
"program": "${workspaceFolder}/target/debug/boa_tester",
"args": ["run", "-s", "${input:testPath}", "-vvv"],
"sourceLanguages": ["rust"],
"preLaunchTask": "Cargo Build boa_tester"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition! :)

@HalidOdat HalidOdat added this pull request to the merge queue Apr 5, 2024
Merged via the queue into boa-dev:main with commit 958045c Apr 5, 2024
14 checks passed
@hansl hansl deleted the fix-test262-relative-imports branch April 6, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context::get_active_script_or_module should return a script or module when using import in a generator
3 participants