Browse Source

Support typed array default values in extension API

The API JSON has changed syntax for default values of typed arrays. This
detects the new format and use initializer lists (currently empty since
the TypedArray class does not support initializer list construction and
default values are always empty arrays).
George Marques 2 years ago
parent
commit
1c625befa3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      binding_generator.py

+ 2 - 0
binding_generator.py

@@ -2129,6 +2129,8 @@ def correct_default_value(value, type_name):
         return value_map[value]
         return value_map[value]
     if value == "":
     if value == "":
         return f"{type_name}()"
         return f"{type_name}()"
+    if value.startswith("Array["):
+        return f"{{}}"
     return value
     return value