mirror of
https://github.com/tars-node/tars2node.git
synced 2024-03-22 13:10:56 +08:00
tars2node js&&ts fix JSON_VERSION support bug
This commit is contained in:
parent
b3c317fbd1
commit
f5799d8369
Binary file not shown.
|
@ -241,7 +241,7 @@ string CodeGenerator::generateDispatch(const NamespacePtr &nPtr, const Interface
|
||||||
StructPtr sPtr = StructPtr::dynamicCast(vParamDecl[i]->getTypeIdPtr()->getTypePtr());
|
StructPtr sPtr = StructPtr::dynamicCast(vParamDecl[i]->getTypeIdPtr()->getTypePtr());
|
||||||
if (sPtr)
|
if (sPtr)
|
||||||
{
|
{
|
||||||
dstr << TAB << "var " << vParamDecl[i]->getTypeIdPtr()->getId()
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
<< " = " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
<< " = " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
||||||
<< ";" << endl;
|
<< ";" << endl;
|
||||||
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() << ".readFromObject("
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() << ".readFromObject("
|
||||||
|
@ -250,7 +250,7 @@ string CodeGenerator::generateDispatch(const NamespacePtr &nPtr, const Interface
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dstr << TAB << "var " << vParamDecl[i]->getTypeIdPtr()->getId()
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
<< " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId()
|
<< " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
<< ";" << endl;
|
<< ";" << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,17 +198,63 @@ string CodeGenerator::generateTSServerDispatch(const NamespacePtr &nPtr, const I
|
||||||
|
|
||||||
for (size_t i = 0; i < vParamDecl.size(); i++)
|
for (size_t i = 0; i < vParamDecl.size(); i++)
|
||||||
{
|
{
|
||||||
|
// if (vParamDecl[i]->isOut())
|
||||||
|
// {
|
||||||
|
// dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
// << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " || " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
||||||
|
// << ";" << endl;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
// << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
// << ";" << endl;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
if (vParamDecl[i]->isOut())
|
if (vParamDecl[i]->isOut())
|
||||||
{
|
{
|
||||||
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
StructPtr sPtr = StructPtr::dynamicCast(vParamDecl[i]->getTypeIdPtr()->getTypePtr());
|
||||||
|
if (sPtr)
|
||||||
|
{
|
||||||
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
<< " = " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
||||||
|
<< ";" << endl;
|
||||||
|
dstr << TAB << "_data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " ? " << vParamDecl[i]->getTypeIdPtr()->getId() << ".readFromObject("
|
||||||
|
<< "_data_." << vParamDecl[i]->getTypeIdPtr()->getId() << ") : " << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
<< ";" << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
<< " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " || " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
<< " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " || " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
||||||
<< ";" << endl;
|
<< ";" << endl;
|
||||||
|
}
|
||||||
|
// dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
// << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId() << " || " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
||||||
|
// << ";" << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
// dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
<< " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId()
|
// << " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
<< ";" << endl;
|
// << ";" << endl;
|
||||||
|
StructPtr sPtr = StructPtr::dynamicCast(vParamDecl[i]->getTypeIdPtr()->getTypePtr());
|
||||||
|
if (sPtr)
|
||||||
|
{
|
||||||
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
<< " = " << getDefault(vParamDecl[i]->getTypeIdPtr(), "", nPtr->getId(), true)
|
||||||
|
<< ";" << endl;
|
||||||
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId() << ".readFromObject("
|
||||||
|
<< "_data_." << vParamDecl[i]->getTypeIdPtr()->getId() << ")"
|
||||||
|
<< ";" << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dstr << TAB << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
<< " = _data_." << vParamDecl[i]->getTypeIdPtr()->getId()
|
||||||
|
<< ";" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEL_TAB;
|
DEL_TAB;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user