mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 876605 - Simplify the Init function of WebIDL dictionaries; r=smaug
This commit is contained in:
parent
8b0216fd01
commit
7c7b789273
@ -7640,7 +7640,15 @@ class CGDictionary(CGThing):
|
||||
"// Per spec, we init the parent's members first\n"
|
||||
"if (!%s::Init(cx, val)) {\n"
|
||||
" return false;\n"
|
||||
"}\n") % self.makeClassName(self.dictionary.parent)
|
||||
"}\n"
|
||||
"MOZ_ASSERT(IsConvertibleToDictionary(cx, val));\n"
|
||||
"\n") % self.makeClassName(self.dictionary.parent)
|
||||
else:
|
||||
body += (
|
||||
"if (!IsConvertibleToDictionary(cx, val)) {\n"
|
||||
" return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY);\n"
|
||||
"}\n"
|
||||
"\n")
|
||||
|
||||
memberInits = [self.getMemberConversion(m).define()
|
||||
for m in self.memberInfo]
|
||||
@ -7649,14 +7657,6 @@ class CGDictionary(CGThing):
|
||||
"JSBool found;\n"
|
||||
"JS::Rooted<JS::Value> temp(cx);\n"
|
||||
"bool isNull = val.isNullOrUndefined();\n")
|
||||
|
||||
body += (
|
||||
"if (!IsConvertibleToDictionary(cx, val)) {\n"
|
||||
" return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY);\n"
|
||||
"}\n"
|
||||
"\n")
|
||||
|
||||
if memberInits:
|
||||
body += "\n\n".join(memberInits) + "\n"
|
||||
|
||||
body += "return true;"
|
||||
|
Loading…
Reference in New Issue
Block a user