From 3bcb193cb9aa640d935c1a2d3a33215692dcebfa Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Thu, 29 Mar 2007 19:32:59 +0000
Subject: [PATCH] Fix symbol lookup issue via a caller() hack.  Not sure what
 the underlying problem is, but this allows fpsDisplay() to be called both as
 a command handler and as a function.

---
 Nasal/gui.nas | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Nasal/gui.nas b/Nasal/gui.nas
index 9c2af5389..bef098a39 100644
--- a/Nasal/gui.nas
+++ b/Nasal/gui.nas
@@ -85,8 +85,8 @@ settimer(INIT, 1);
 ##
 # Show/hide the fps display dialog.
 #
-fpsDisplay = func(v = nil) {
-    var w = v != nil ? v : cmdarg().getBoolValue();
+fpsDisplay = func {
+    var w = (caller(0)[0]["arg"] == nil) ? cmdarg().getBoolValue() : arg[0];
     fgcommand(w ? "dialog-show" : "dialog-close", props.Node.new({"dialog-name": "fps"}));
 }