summaryrefslogtreecommitdiff
path: root/cpp/src/slice2js/JsUtil.cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-01-24 10:33:49 +0100
committerJose <jose@zeroc.com>2017-01-24 10:33:49 +0100
commit4a4250603b046265e23869937f30a72d8396fe88 (patch)
treef26243fa9b7add3cb1fe252db75d9a602d6144ef /cpp/src/slice2js/JsUtil.cpp
parentDo not add abstract methods to PHP Value classes (diff)
downloadice-4a4250603b046265e23869937f30a72d8396fe88.tar.bz2
ice-4a4250603b046265e23869937f30a72d8396fe88.tar.xz
ice-4a4250603b046265e23869937f30a72d8396fe88.zip
JavaScript: Do not generate proxy types for class less operations
Diffstat (limited to 'cpp/src/slice2js/JsUtil.cpp')
-rw-r--r--cpp/src/slice2js/JsUtil.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/cpp/src/slice2js/JsUtil.cpp b/cpp/src/slice2js/JsUtil.cpp
index 8046c115102..674644873d4 100644
--- a/cpp/src/slice2js/JsUtil.cpp
+++ b/cpp/src/slice2js/JsUtil.cpp
@@ -574,10 +574,24 @@ Slice::JsGenerator::getHelper(const TypePtr& type)
return typeToString(type) + "._helper";
}
- if(ProxyPtr::dynamicCast(type) || StructPtr::dynamicCast(type))
+ if(StructPtr::dynamicCast(type))
{
return typeToString(type);
}
+
+ ProxyPtr prx = ProxyPtr::dynamicCast(type);
+ if(prx)
+ {
+ ClassDefPtr def = prx->_class()->definition();
+ if(def->isInterface() || def->allOperations().size() > 0)
+ {
+ return typeToString(type);
+ }
+ else
+ {
+ return "Ice.ObjectPrx";
+ }
+ }
if(SequencePtr::dynamicCast(type) || DictionaryPtr::dynamicCast(type))
{