Skip to content

Commit

Permalink
[PRISM] Emit END event for modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed May 17, 2024
1 parent 0649c1e commit c60cdbd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion prism_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -8745,7 +8745,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
break;
}

if (PM_NODE_TYPE_P(scope_node->ast_node, PM_CLASS_NODE)) {
if (PM_NODE_TYPE_P(scope_node->ast_node, PM_CLASS_NODE) || PM_NODE_TYPE_P(scope_node->ast_node, PM_MODULE_NODE)) {
const pm_line_column_t end_location = PM_NODE_END_LINE_COLUMN(scope_node->parser, scope_node->ast_node);
ADD_TRACE(ret, RUBY_EVENT_END);
ISEQ_COMPILE_DATA(iseq)->last_line = end_location.line;
Expand Down
4 changes: 0 additions & 4 deletions spec/prism.mspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# frozen_string_literal: true

# We are missing emitting some :end event inside eval; we need more
# investigation here.
MSpec.register(:exclude, "TracePoint#path equals \"(eval at __FILE__:__LINE__)\" inside an eval for :end event")

# We need to respect the eval coverage setting.
MSpec.register(:exclude, "Coverage.result returns the correct results when eval coverage is disabled")

0 comments on commit c60cdbd

Please sign in to comment.