mirror of
https://github.com/opencv/opencv.git
synced 2025-06-18 08:05:23 +08:00
js: robust code generation
- avoid randomized output due to unpredictable dict/set order
This commit is contained in:
parent
9b4adc9acb
commit
f8740e124c
@ -776,15 +776,13 @@ class JSWrapperGenerator(object):
|
|||||||
self.bindings+=binding
|
self.bindings+=binding
|
||||||
|
|
||||||
# generate code for the classes and their methods
|
# generate code for the classes and their methods
|
||||||
class_list = list(self.classes.items())
|
for name, class_info in sorted(self.classes.items()):
|
||||||
|
|
||||||
for name, class_info in class_list:
|
|
||||||
class_bindings = []
|
class_bindings = []
|
||||||
if not name in white_list:
|
if not name in white_list:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Generate bindings for methods
|
# Generate bindings for methods
|
||||||
for method_name, method in class_info.methods.items():
|
for method_name, method in sorted(class_info.methods.items()):
|
||||||
if method.cname in ignore_list:
|
if method.cname in ignore_list:
|
||||||
continue
|
continue
|
||||||
if not method.name in white_list[method.class_name]:
|
if not method.name in white_list[method.class_name]:
|
||||||
@ -822,7 +820,7 @@ class JSWrapperGenerator(object):
|
|||||||
|
|
||||||
|
|
||||||
# Generate bindings for properties
|
# Generate bindings for properties
|
||||||
for property in class_info.props:
|
for property in sorted(class_info.props):
|
||||||
_class_property = class_property_enum_template if property.tp in type_dict else class_property_template
|
_class_property = class_property_enum_template if property.tp in type_dict else class_property_template
|
||||||
class_bindings.append(_class_property.substitute(js_name=property.name, cpp_name='::'.join(
|
class_bindings.append(_class_property.substitute(js_name=property.name, cpp_name='::'.join(
|
||||||
[class_info.cname, property.name])))
|
[class_info.cname, property.name])))
|
||||||
|
Loading…
Reference in New Issue
Block a user