I suspect rev 1812 "Implicit cast didn't work in initialization of global vars" broke the dictionary addon in case a global String object was passed as the agument for the get method.
r = engine->RegisterObjectMethod("Dictionary", "void set(const String &in, ?&in)", asFUNCTION(ScriptDictionarySet_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectMethod("Dictionary", "bool get(const String &in, ?&out) const", asFUNCTION(ScriptDictionaryGet_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectMethod("Dictionary", "void set(const String &in, int64&in)", asFUNCTION(ScriptDictionarySetInt_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectMethod("Dictionary", "bool get(const String &in, int64&out) const", asFUNCTION(ScriptDictionaryGetInt_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectMethod("Dictionary", "void set(const String &in, double&in)", asFUNCTION(ScriptDictionarySetFlt_Generic), asCALL_GENERIC); assert( r >= 0 );
r = engine->RegisterObjectMethod("Dictionary", "bool get(const String &in, double&out) const", asFUNCTION(ScriptDictionaryGetFlt_Generic), asCALL_GENERIC); assert( r >= 0 );
AS code:
String browserTableName = ''; // persistent for document's lifetime
...
// get the 'servers' query string parameter value
const Dictionary @dict = body.ownerDocument.URL.getParameters();
dict.get( 'servers', browserTableName );
browserTableName is a global var and instead of proper values it gets assigned bizarre values such as '1.12398e-315'. Debugging the code actually reveals that AS hits the following codepath in CScriptDictionary::Get(const asstring_t &key, void *value, int typeId) const:
// We know all numbers are stored as either int64 or double, since we register overloaded functions for those
if( it->second.typeId == asTYPEID_INT64 && typeId == asTYPEID_DOUBLE )
{
*(double*)value = double(it->second.valueInt);
return true;
}
I haven't managed to prove my suspicion correct since I'm about to hit the bed but something tells me I'm on the right track here..