зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1436308
- Generate a ToJSON() method for WebIDL types with records r=bz
We currently don't generate a ::ToJSON() method for WebIDL types with record<K,V> members. These types should be safe to convert to JSON, as long as type V itself is. Per spec, type K is always a DOMString, USVString, or ByteString.
This commit is contained in:
Родитель
081a738eb4
Коммит
1d2ba2eb2b
|
@ -13823,6 +13823,11 @@ class CGDictionary(CGThing):
|
|||
# they're not unrestricted float/double.
|
||||
return not type.isFloat() or not type.isUnrestricted()
|
||||
|
||||
if type.isRecord():
|
||||
# Records are okay, as long as the value type is.
|
||||
# Per spec, only strings are allowed as keys.
|
||||
return CGDictionary.typeSafeToJSONify(type.inner)
|
||||
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
|
Загрузка…
Ссылка в новой задаче