Undefined functions called in scripts are now always errors.
Johnny C. Lam [11-15-13 - 19:56]
Undefined functions called in scripts are now always errors.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1167 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleCompile.lua b/OvaleCompile.lua
index 7df6cfa..f69160e 100644
--- a/OvaleCompile.lua
+++ b/OvaleCompile.lua
@@ -56,7 +56,6 @@ local self_compileOnStances = false
local OVALE_COMPILE_DEBUG = "compile"
local OVALE_MISSING_SPELL_DEBUG = "missing_spells"
-local OVALE_UNKNOWN_FUNCTION_DEBUG = "unknown_function"
local OVALE_UNKNOWN_SPELL_DEBUG = "unknown_spells"
-- Parameters used as conditionals in script declarations.
@@ -814,11 +813,9 @@ local function CompileScript(text)
end
-- Verify that all the functions called within the script are defined.
- -- Not an error if a function is undefined (might be unreachable code), but complain
- -- at run-time during compilation.
for p, v in pairs(self_functionCalls) do
if not (OVALE_FUNCTIONS[p] or self_customFunctions[p] or OvaleCondition:IsCondition(p)) then
- Ovale:DebugPrintf(OVALE_UNKNOWN_FUNCTION_DEBUG, "Unknown function call: %s (node%s)", p, v.nodeId)
+ Ovale:Errorf("Unknown function call: %s (node%s)", p, v.nodeId)
end
end
diff --git a/OvaleOptions.lua b/OvaleOptions.lua
index a6ce701..adfb8ea 100644
--- a/OvaleOptions.lua
+++ b/OvaleOptions.lua
@@ -533,12 +533,6 @@ local self_options =
desc = L["Debug stat snapshots"],
type = "toggle",
},
- unknown_function =
- {
- name = "Unknown functions",
- desc = L["Debug unknown functions"],
- type = "toggle",
- },
unknown_spells =
{
name = "Unknown spells",