Skip to content

Commit de1b919

Browse files
committed
Merge pull request opencv#19161 from alalek:js_robust_code_generation
2 parents 03e224e + f8740e1 commit de1b919

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

modules/js/generator/embindgen.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -776,15 +776,13 @@ def gen(self, dst_file, src_files, core_bindings):
776776
self.bindings+=binding
777777

778778
# generate code for the classes and their methods
779-
class_list = list(self.classes.items())
780-
781-
for name, class_info in class_list:
779+
for name, class_info in sorted(self.classes.items()):
782780
class_bindings = []
783781
if not name in white_list:
784782
continue
785783

786784
# Generate bindings for methods
787-
for method_name, method in class_info.methods.items():
785+
for method_name, method in sorted(class_info.methods.items()):
788786
if method.cname in ignore_list:
789787
continue
790788
if not method.name in white_list[method.class_name]:
@@ -822,7 +820,7 @@ def gen(self, dst_file, src_files, core_bindings):
822820

823821

824822
# Generate bindings for properties
825-
for property in class_info.props:
823+
for property in sorted(class_info.props):
826824
_class_property = class_property_enum_template if property.tp in type_dict else class_property_template
827825
class_bindings.append(_class_property.substitute(js_name=property.name, cpp_name='::'.join(
828826
[class_info.cname, property.name])))

0 commit comments

Comments
 (0)