| Index: tools/json_schema_compiler/js_externs_generator.py
|
| diff --git a/tools/json_schema_compiler/js_externs_generator.py b/tools/json_schema_compiler/js_externs_generator.py
|
| index e0a09ff7f270bb4b836f248e33bb605bb91b95bb..beba10e04c5d9bee2dfb4f93bef9e3e296f273b3 100644
|
| --- a/tools/json_schema_compiler/js_externs_generator.py
|
| +++ b/tools/json_schema_compiler/js_externs_generator.py
|
| @@ -180,7 +180,7 @@ class _Generator(object):
|
| elif js_type.property_type is PropertyType.OBJECT:
|
| return 'Object'
|
| elif js_type.property_type is PropertyType.ARRAY:
|
| - return 'Array'
|
| + return '!Array<%s>' % self._TypeToJsType(js_type.item_type)
|
| elif js_type.property_type is PropertyType.REF:
|
| ref_type = js_type.ref_type
|
| # Enums are defined as chrome.fooAPI.MyEnum, but types are defined simply
|
| @@ -188,6 +188,9 @@ class _Generator(object):
|
| if self._namespace.types[ref_type].property_type is PropertyType.ENUM:
|
| ref_type = 'chrome.%s.%s' % (self._namespace.name, ref_type)
|
| return ref_type
|
| + elif js_type.property_type is PropertyType.CHOICES:
|
| + return '(%s)' % '|'.join(
|
| + [self._TypeToJsType(choice) for choice in js_type.choices])
|
| elif js_type.property_type.is_fundamental:
|
| return js_type.property_type.name
|
| else:
|
|
|