summaryrefslogtreecommitdiff
path: root/cpp/src/slice2js/Gen.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-06-08 19:38:30 +0200
committerJose <jose@zeroc.com>2018-06-08 19:38:30 +0200
commit7b8b81e6bd765885e2d49c86cd8d9d3340394594 (patch)
tree5d90a0965cc745bd529223c6881f402cf03fc8e4 /cpp/src/slice2js/Gen.cpp
parentIceGridGUI: improvement session lost message (diff)
downloadice-7b8b81e6bd765885e2d49c86cd8d9d3340394594.tar.bz2
ice-7b8b81e6bd765885e2d49c86cd8d9d3340394594.tar.xz
ice-7b8b81e6bd765885e2d49c86cd8d9d3340394594.zip
JavaScript stream interface fixes
Fixes #98 Fixes #92
Diffstat (limited to 'cpp/src/slice2js/Gen.cpp')
-rw-r--r--cpp/src/slice2js/Gen.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/cpp/src/slice2js/Gen.cpp b/cpp/src/slice2js/Gen.cpp
index 01e0ae83c16..804e3d5ee32 100644
--- a/cpp/src/slice2js/Gen.cpp
+++ b/cpp/src/slice2js/Gen.cpp
@@ -1424,7 +1424,11 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p)
<< "\"" << getHelper(type) << "\"" << ", " << (fixed ? "true" : "false");
if(isClassType(type))
{
- _out<< ", \"" << typeToString(type) << "\"";
+ bool interface =
+ ClassDeclPtr::dynamicCast(type) &&
+ ClassDeclPtr::dynamicCast(type)->definition() &&
+ ClassDeclPtr::dynamicCast(type)->definition()->isInterface();
+ _out<< ", \"" << (interface ? "Ice.Value" : typeToString(type)) << "\"";
}
_out << ");";
}
@@ -1692,10 +1696,15 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p)
const string propertyName = name + "Helper";
bool fixed = !keyType->isVariableLength() && !valueType->isVariableLength();
+ bool interface =
+ ClassDeclPtr::dynamicCast(valueType) &&
+ ClassDeclPtr::dynamicCast(valueType)->definition() &&
+ ClassDeclPtr::dynamicCast(valueType)->definition()->isInterface();
+
_out << sp;
_out << nl << "Slice.defineDictionary(" << scope << ", \"" << name << "\", \"" << propertyName << "\", "
<< "\"" << getHelper(keyType) << "\", "
- << "\"" << getHelper(valueType) << "\", "
+ << "\"" << (interface ? "Ice.Value" : getHelper(valueType)) << "\", "
<< (fixed ? "true" : "false") << ", "
<< (keyUseEquals ? "Ice.HashMap.compareEquals" : "undefined");