Bug 1246153 part 1. Restrict initialization of dictionaries from JSON to dictionaries that can actually be represented in JSON. r=bholley

This commit is contained in:
Boris Zbarsky 2016-04-04 12:16:13 -04:00
Родитель c8663502fd
Коммит 190e8db66b
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -12485,10 +12485,12 @@ class CGDictionary(CGThing):
methods.append(self.initIdsMethod())
methods.append(self.initMethod())
methods.append(self.initFromJSONMethod())
canBeRepresentedAsJSON = self.dictionarySafeToJSONify(self.dictionary)
if canBeRepresentedAsJSON:
methods.append(self.initFromJSONMethod())
try:
methods.append(self.toObjectInternalMethod())
if self.dictionarySafeToJSONify(self.dictionary):
if canBeRepresentedAsJSON:
methods.append(self.toJSONMethod())
except MethodNotNewObjectError:
# If we can't have a ToObjectInternal() because one of our members