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).
pull/1018/head
George Marques 2023-01-28 14:01:27 -03:00
parent 64be8c1507
commit 1c625befa3
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 2 additions and 0 deletions

View File

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