1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Fix generation when returned class and function are in a namespace

This is to fix js generation at HEAD with ximgproc.
This commit is contained in:
Vincent Rabaud
2025-11-04 11:17:29 +01:00
parent 01f9bdae4c
commit f984d3bdc7
+4
View File
@@ -849,6 +849,10 @@ class JSWrapperGenerator(object):
# Register the smart pointer
base_class_name = variant.rettype
base_class_name = base_class_name.replace("Ptr<","").replace(">","").strip()
if base_class_name not in self.classes:
new_base_class_name = '%s_%s' % (ns_id, base_class_name)
print(base_class_name, ' not found in classes for registering smart pointer using ', new_base_class_name, 'instead')
base_class_name = new_base_class_name
self.classes[base_class_name].has_smart_ptr = True
# Adds the external constructor