Test FixedVector{2,3}D script conversions, and test calling functions of the prototypes.

Also ENSURE that the given value identifier is actually present in the
cache instead of creating one if it is not.

This was SVN commit r17603.
This commit is contained in:
leper
2016-01-04 21:41:40 +00:00
parent 4c4beb8450
commit b18cd3254c
4 changed files with 109 additions and 8 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2015 Wildfire Games.
/* Copyright (C) 2016 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -449,7 +449,9 @@ ScriptInterface::CxPrivate* ScriptInterface::GetScriptInterfaceAndCBData(JSConte
JS::Value ScriptInterface::GetCachedValue(CACHED_VAL valueIdentifier)
{
return m->m_ScriptValCache[valueIdentifier].get();
std::map<ScriptInterface::CACHED_VAL, DefPersistentRooted<JS::Value>>::iterator it = m->m_ScriptValCache.find(valueIdentifier);
ENSURE(it != m->m_ScriptValCache.end());
return it->second.get();
}