Skip to content

Commit

Permalink
[YARP] ClassNode and ModuleNode use name_constant (#8384)
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmaissroff committed Sep 6, 2023
1 parent b3b57f7 commit 1d4d9a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yarp/yarp_compiler.c
Expand Up @@ -597,7 +597,7 @@ yp_compile_node(rb_iseq_t *iseq, const yp_node_t *node, LINK_ANCHOR *const ret,
yp_scope_node_t scope_node;
yp_scope_node_init((yp_node_t *)class_node, &scope_node);

ID class_id = parse_string_symbol(&class_node->name);
ID class_id = yp_constant_id_lookup(compile_context, class_node->name_constant);

VALUE class_name = rb_str_freeze(rb_sprintf("<class:%"PRIsVALUE">", rb_id2str(class_id)));

Expand Down Expand Up @@ -1463,7 +1463,7 @@ yp_compile_node(rb_iseq_t *iseq, const yp_node_t *node, LINK_ANCHOR *const ret,
yp_scope_node_t scope_node;
yp_scope_node_init((yp_node_t *)module_node, &scope_node);

ID module_id = parse_string_symbol(&module_node->name);
ID module_id = yp_constant_id_lookup(compile_context, module_node->name_constant);
VALUE module_name = rb_str_freeze(rb_sprintf("<module:%"PRIsVALUE">", rb_id2str(module_id)));

const rb_iseq_t *module_iseq = NEW_CHILD_ISEQ(&scope_node, module_name, ISEQ_TYPE_CLASS, lineno);
Expand Down

0 comments on commit 1d4d9a0

Please sign in to comment.