Skip to content

Commit 23f8812

Browse files
committed
[[ Bug 14993 ]] Emit 'undefined' type as 'nothing' in interface file.
1 parent cbe915c commit 23f8812

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

libscript/src/script-module.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,15 +1136,22 @@ static void def_to_name(MCScriptModuleRef self, uindex_t p_index, MCStringRef& r
11361136
{
11371137
MCScriptDefinition *t_def;
11381138
t_def = self -> definitions[p_index];
1139+
1140+
MCNameRef t_name;
11391141
if (t_def -> kind == kMCScriptDefinitionKindExternal)
11401142
{
11411143
MCScriptExternalDefinition *t_ext_def;
11421144
t_ext_def = static_cast<MCScriptExternalDefinition *>(t_def);
11431145

1144-
MCStringFormat(r_string, "%@", /*self -> dependencies[self -> imported_definitions[t_ext_def -> index] . module] . name, */self -> imported_definitions[t_ext_def -> index] . name);
1146+
t_name = self -> imported_definitions[t_ext_def -> index] . name;
11451147
}
11461148
else
1147-
MCStringFormat(r_string, "%@", self -> definition_names[p_index]);
1149+
t_name = self -> definition_names[p_index];
1150+
1151+
if (!MCNameIsEqualTo(t_name, MCNAME("undefined")))
1152+
MCStringFormat(r_string, "%@", t_name);
1153+
else
1154+
MCStringFormat(r_string, "nothing");
11481155
}
11491156

11501157
static void type_to_string(MCScriptModuleRef self, uindex_t p_type, MCStringRef& r_string)

0 commit comments

Comments
 (0)