|
|
@ -482,7 +482,7 @@ class JSWrapperGenerator(object): |
|
|
|
ret_type = type_dict[ptr_type] |
|
|
|
ret_type = type_dict[ptr_type] |
|
|
|
for key in type_dict: |
|
|
|
for key in type_dict: |
|
|
|
if key in ret_type: |
|
|
|
if key in ret_type: |
|
|
|
ret_type = re.sub('(^|[^\w])' + key + '($|[^\w])', type_dict[key], ret_type) |
|
|
|
ret_type = re.sub(r"\b" + key + r"\b", type_dict[key], ret_type) |
|
|
|
arg_types = [] |
|
|
|
arg_types = [] |
|
|
|
unwrapped_arg_types = [] |
|
|
|
unwrapped_arg_types = [] |
|
|
|
for arg in variant.args: |
|
|
|
for arg in variant.args: |
|
|
@ -670,7 +670,7 @@ class JSWrapperGenerator(object): |
|
|
|
# Replace types. Instead of ret_type.replace we use regular |
|
|
|
# Replace types. Instead of ret_type.replace we use regular |
|
|
|
# expression to exclude false matches. |
|
|
|
# expression to exclude false matches. |
|
|
|
# See https://github.com/opencv/opencv/issues/15514 |
|
|
|
# See https://github.com/opencv/opencv/issues/15514 |
|
|
|
ret_type = re.sub('(^|[^\w])' + key + '($|[^\w])', type_dict[key], ret_type) |
|
|
|
ret_type = re.sub(r"\b" + key + r"\b", type_dict[key], ret_type) |
|
|
|
if variant.constret and ret_type.startswith('const') == False: |
|
|
|
if variant.constret and ret_type.startswith('const') == False: |
|
|
|
ret_type = 'const ' + ret_type |
|
|
|
ret_type = 'const ' + ret_type |
|
|
|
if variant.refret and ret_type.endswith('&') == False: |
|
|
|
if variant.refret and ret_type.endswith('&') == False: |
|
|
|