Skip to content

Comments

refactor(semantic): move Function and ArrowFunctionExpression handling to visit methods#12630

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods
Jul 31, 2025
Merged

refactor(semantic): move Function and ArrowFunctionExpression handling to visit methods#12630
graphite-app[bot] merged 1 commit intomainfrom
c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Jul 30, 2025

Part of #18098.

@github-actions github-actions bot added A-semantic Area - Semantic C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Jul 30, 2025
@camc314 camc314 marked this pull request as ready for review July 30, 2025 13:24
@camc314 camc314 requested a review from Dunqing as a code owner July 30, 2025 13:24
Copy link
Contributor Author

camc314 commented Jul 30, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camc314 camc314 changed the base branch from c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class to graphite-base/12630 July 30, 2025 13:25
@camc314 camc314 force-pushed the c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods branch from 01fa88f to 76e6ef6 Compare July 30, 2025 13:26
@camc314 camc314 force-pushed the graphite-base/12630 branch from 96bcd69 to 31c7384 Compare July 30, 2025 13:27
@camc314 camc314 changed the base branch from graphite-base/12630 to c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class July 30, 2025 13:27
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 30, 2025

CodSpeed Instrumentation Performance Report

Merging #12630 will not alter performance

Comparing c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods (109fc3c) with main (8369bbd)

Summary

✅ 34 untouched benchmarks

@camc314 camc314 changed the base branch from c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class to graphite-base/12630 July 30, 2025 13:31
@camc314 camc314 changed the base branch from graphite-base/12630 to c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class July 30, 2025 13:33
@camc314 camc314 changed the base branch from c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class to graphite-base/12630 July 30, 2025 13:37
@camc314 camc314 force-pushed the graphite-base/12630 branch from 31c7384 to 404aa3c Compare July 30, 2025 15:05
@camc314 camc314 force-pushed the c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods branch from 76e6ef6 to 18d3502 Compare July 30, 2025 15:05
@camc314 camc314 changed the base branch from graphite-base/12630 to c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class July 30, 2025 15:05
@camc314 camc314 changed the base branch from c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class to graphite-base/12630 July 30, 2025 15:07
@camc314 camc314 changed the base branch from graphite-base/12630 to c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class July 30, 2025 15:10
@camc314 camc314 changed the base branch from c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class to graphite-base/12630 July 30, 2025 15:11
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Jul 31, 2025
Copy link
Member

overlookmotel commented Jul 31, 2025

Merge activity

@graphite-app graphite-app bot requested a review from leaysgur as a code owner July 31, 2025 08:40
@github-actions github-actions bot added A-parser Area - Parser A-minifier Area - Minifier A-ast Area - AST A-transformer Area - Transformer / Transpiler A-codegen Area - Code Generation A-cfg Area - Control Flow Graph A-isolated-declarations Isolated Declarations labels Jul 31, 2025
@graphite-app graphite-app bot changed the base branch from graphite-base/12630 to c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class July 31, 2025 08:40
Base automatically changed from c/07-30-refactor_semantic_move_astkind_class_handling_from_leave_kind_to_visit_class to main July 31, 2025 08:47
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 31, 2025
@overlookmotel overlookmotel force-pushed the c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods branch from 342f199 to 9e8cbe8 Compare July 31, 2025 08:50
@overlookmotel overlookmotel added 0-merge Merge with Graphite Merge Queue and removed A-parser Area - Parser A-minifier Area - Minifier A-ast Area - AST A-transformer Area - Transformer / Transpiler A-codegen Area - Code Generation A-cfg Area - Control Flow Graph A-isolated-declarations Isolated Declarations labels Jul 31, 2025
@graphite-app graphite-app bot force-pushed the c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods branch from 9e8cbe8 to 109fc3c Compare July 31, 2025 08:51
@graphite-app graphite-app bot merged commit 109fc3c into main Jul 31, 2025
25 checks passed
@graphite-app graphite-app bot deleted the c/07-30-refactor_semantic_move_function_and_arrowfunctionexpression_handling_to_visit_methods branch July 31, 2025 08:59
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 31, 2025
graphite-app bot pushed a commit that referenced this pull request Aug 1, 2025
Only purpose of `function_stack` in `SemanticBuilder` is to track the current function, in order to set `NodeFlags::HasYield` on it if it contains `yield`.

#12630 moved enter and exit logic into `visit_function`. So now we don't need a `Stack` to track the current function, we can use vars on the actual stack.

Also, it's unnecessary to update current function when entering/exiting arrow functions, as they can't contain `yield`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-semantic Area - Semantic C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants