зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1250985 - Part 1: Add a way to identify whether a WebIDL dictionary has any members present; r=bzbarsky
This commit is contained in:
Родитель
6e150071f6
Коммит
afaabe46dc
|
@ -50,11 +50,19 @@ protected:
|
|||
struct FastDictionaryInitializer {
|
||||
};
|
||||
|
||||
bool mIsAnyMemberPresent = false;
|
||||
|
||||
private:
|
||||
// aString is expected to actually be an nsAString*. Should only be
|
||||
// called from StringifyToJSON.
|
||||
static bool AppendJSONToString(const char16_t* aJSONData,
|
||||
uint32_t aDataLength, void* aString);
|
||||
|
||||
public:
|
||||
bool IsAnyMemberPresent() const
|
||||
{
|
||||
return mIsAnyMemberPresent;
|
||||
}
|
||||
};
|
||||
|
||||
// Struct that serves as a base class for all typed arrays and array buffers and
|
||||
|
|
|
@ -12530,6 +12530,10 @@ class CGDictionary(CGThing):
|
|||
"convert": string.Template(conversionInfo.template).substitute(replacements),
|
||||
"propGet": propGet
|
||||
}
|
||||
# The conversion code will only run where a default value or a value passed
|
||||
# by the author needs to get converted, so we can remember if we have any
|
||||
# members present here.
|
||||
conversionReplacements["convert"] += "mIsAnyMemberPresent = true;\n"
|
||||
conversion = ("if (!isNull && !${propGet}) {\n"
|
||||
" return false;\n"
|
||||
"}\n")
|
||||
|
|
Загрузка…
Ссылка в новой задаче