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

Fix tagged template creation #2925

Merged
merged 4 commits into from
May 17, 2023
Merged

Fix tagged template creation #2925

merged 4 commits into from
May 17, 2023

Conversation

raskad
Copy link
Member

@raskad raskad commented May 10, 2023

This Pull Request changes the following:

  • Refactor the creation of tagged templates.
  • Add a unique identifier to tagged template parse nodes that is used at runtime to cache them.
  • Add an identifier to the parser that is incemented when eval code is parsed. This is needed because tagged templates parsed by different eval calls are unique.

@raskad raskad added bug Something isn't working parser Issues surrounding the parser execution Issues or PRs related to code execution labels May 10, 2023
@raskad raskad added this to the v0.17.0 milestone May 10, 2023
@raskad raskad requested a review from a team May 10, 2023 22:12
@github-actions
Copy link

github-actions bot commented May 10, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,657 94,657 0
Passed 73,901 73,915 +14
Ignored 17,505 17,505 0
Failed 3,251 3,237 -14
Panics 0 0 0
Conformance 78.07% 78.09% +0.01%
Fixed tests (14):
test/language/expressions/tagged-template/template-object-frozen-non-strict.js (previously Failed)
test/language/expressions/tagged-template/template-object.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/template-object.js (previously Failed)
test/language/expressions/tagged-template/cache-eval-inner-function.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/cache-eval-inner-function.js (previously Failed)
test/language/expressions/tagged-template/cache-same-site.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/cache-same-site.js (previously Failed)
test/language/expressions/tagged-template/template-object-frozen-strict.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/template-object-template-map.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/template-object-template-map.js (previously Failed)
test/language/expressions/tagged-template/cache-different-functions-same-site.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/cache-different-functions-same-site.js (previously Failed)
test/language/expressions/tagged-template/cache-same-site-top-level.js [strict mode] (previously Failed)
test/language/expressions/tagged-template/cache-same-site-top-level.js (previously Failed)

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #2925 (e2e9b87) into main (c827313) will increase coverage by 0.19%.
The diff coverage is 73.33%.

@@            Coverage Diff             @@
##             main    #2925      +/-   ##
==========================================
+ Coverage   51.98%   52.17%   +0.19%     
==========================================
  Files         431      436       +5     
  Lines       43647    43798     +151     
==========================================
+ Hits        22690    22853     +163     
+ Misses      20957    20945      -12     
Impacted Files Coverage Δ
boa_engine/src/vm/code_block.rs 56.08% <0.00%> (-0.49%) ⬇️
boa_engine/src/vm/flowgraph/mod.rs 0.00% <0.00%> (ø)
boa_engine/src/vm/opcode/mod.rs 45.45% <ø> (ø)
boa_engine/src/builtins/function/mod.rs 39.25% <20.00%> (-0.50%) ⬇️
boa_engine/src/context/mod.rs 51.90% <80.00%> (+0.41%) ⬆️
boa_engine/src/vm/opcode/templates/mod.rs 95.83% <95.83%> (ø)
boa_ast/src/expression/tagged_template.rs 100.00% <100.00%> (ø)
boa_engine/src/builtins/eval/mod.rs 64.58% <100.00%> (-1.42%) ⬇️
boa_engine/src/bytecompiler/expression/mod.rs 60.00% <100.00%> (-0.57%) ⬇️
boa_engine/src/realm.rs 83.78% <100.00%> (+3.13%) ⬆️
... and 3 more

... and 15 files with indirect coverage changes

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.

Looks really good! Just a small concern :)

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.

Looks perfect to me! :)

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

LGTM!

@Razican Razican added this pull request to the merge queue May 17, 2023
Merged via the queue into main with commit efeaa40 May 17, 2023
@raskad raskad deleted the tagged-templates branch May 27, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Issues or PRs related to code execution parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants