summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-01-29 16:55:44 +0900
committerNobuyoshi Nakada <[email protected]>2025-03-18 23:47:20 +0900
commitf69ad0e810e1fdc18dc12f77bbecfa49999ef3bf ()
treec78a56901f15314471391d883685a64cda1af232 /variable.c
parent6670926a91734ddb92d01ce4578b1bb48d26b7de (diff)
[Bug #21094] Update nested module names when setting temporary name
Notes: Merged: https://.com/ruby/ruby/pull/12947
-rw-r--r--variable.c82
1 files changed, 80 insertions, 2 deletions
@@ -166,6 +166,80 @@ is_constant_path(VALUE name)
return true;
}
/*
* call-seq:
* mod.set_temporary_name(string) -> self
@@ -224,7 +298,9 @@ rb_mod_set_temporary_name(VALUE mod, VALUE name)
if (NIL_P(name)) {
// Set the temporary classpath to NULL (anonymous):
- RCLASS_SET_CLASSPATH(mod, 0, FALSE);
}
else {
// Ensure the name is a string:
@@ -241,7 +317,9 @@ rb_mod_set_temporary_name(VALUE mod, VALUE name)
name = rb_str_new_frozen(name);
// Set the temporary classpath to the given name:
- RCLASS_SET_CLASSPATH(mod, name, FALSE);
}
return mod;