Maybe I got you wrong but you tried to use namespace as an "optional argument". So why don't you just put nil in the correct place as you call the function?
Lua Code:
ZO_SavedVars:New("TestSV",1, nil, {},"TestProfile")
Edit:
Oh sorry just saw the lines 142ff in the sourcecode and now I understood what you are up to
Lua Code:
--namespace is an optional argument
if defaults == nil and type(namespace) == "table" then
profile = defaults
defaults = namespace
namespace = nil
end
profile = profile or "Default"
if type(profile) ~= "string" then
error("Profile must be a string or nil")
end
Here are the prameters of the function GetNewSavedVars from the live server:
Lua Code:
local function GetNewSavedVars(savedVariableTable, version, namespace, defaults, profile, displayName, characterName, characterId, characterKeyType)
Parameters of ZO_SavedVars:New()
Lua Code:
function ZO_SavedVars:New(savedVariableTable, version, namespace, defaults, profile, displayName, characterName, characterId, characterKeyType)
If you use ZO_SavedVars:New from your example:
Lua Code:
ZO_SavedVars:New("TestSV",1,{},"TestProfile")
savedVariableTable: "TestSV"
version: 1
namespace: {}
defaults: "TestProfile"
profile: nil