1
0
Fork 0

Melchior discovered an interpreter bug that is fixed (or seems to be

-- I need to verify) in current Nasal CVS.  Commit a workaround for
now.  Basically: don't return a tail call from a foreach.
This commit is contained in:
andy 2006-08-27 16:22:06 +00:00
parent f6c6eaf5b7
commit e2de2b4093

View file

@ -196,20 +196,22 @@ Dialog = {
},
};
##
# Open property browser with given target path.
#
property_browser = func(dir = "/") {
var dlgname = "property-browser";
var need_create = 0;
foreach (var module; keys(globals)) {
if (find("__dlg:" ~ dlgname, module) == 0) {
return globals[module].clone(dir);
globals[module].clone(dir);
need_create = 1;
}
}
setprop("/sim/gui/dialogs/" ~ dlgname ~ "/last", dir);
fgcommand("dialog-show", props.Node.new({"dialog-name": dlgname}));
if(need_create) {
setprop("/sim/gui/dialogs/" ~ dlgname ~ "/last", dir);
fgcommand("dialog-show", props.Node.new({"dialog-name": dlgname}));
}
}