Esempio n. 1
0
CJSScript* CKadScript::GetJSScript(bool bInstantiate)
{
	ASSERT(m_pScript || bInstantiate);
	if(!m_pScript && bInstantiate && IsValid())
		m_pScript = MakeScript(m_Source, m_Name, m_Version);
	return m_pScript;
}
Esempio n. 2
0
bool C4ScriptHost::Load(C4Group &hGroup, const char *szFilename,
                        const char *szLanguage, class C4LangStringTable *pLocalTable)
{
	// Base load
	bool fSuccess = ComponentHost.Load(hGroup,szFilename,szLanguage);
	// String Table
	if (stringTable != pLocalTable)
	{
		if (stringTable) stringTable->DelRef();
		stringTable = pLocalTable;
		if (stringTable) stringTable->AddRef();
	}
	// set name
	ScriptName.Ref(ComponentHost.GetFilePath());
	// preparse script
	MakeScript();
	// Success
	return fSuccess;
}