зеркало из https://github.com/mozilla/pjs.git
Bug 747815. Use const strings for arguments in DOM bindings. r=peterv
This commit is contained in:
Родитель
7a7980b4b4
Коммит
719660aa43
|
@ -1247,9 +1247,9 @@ def getArgumentConversionTemplate(type, descriptor):
|
|||
undefinedBehavior = "eStringify"
|
||||
|
||||
return (
|
||||
" xpc_qsDOMString ${name}(cx, ${argVal}, ${argPtr},\n"
|
||||
" xpc_qsDOMString::%s,\n"
|
||||
" xpc_qsDOMString::%s);\n"
|
||||
" const xpc_qsDOMString ${name}(cx, ${argVal}, ${argPtr},\n"
|
||||
" xpc_qsDOMString::%s,\n"
|
||||
" xpc_qsDOMString::%s);\n"
|
||||
" if (!${name}.IsValid()) {\n"
|
||||
" return false;\n"
|
||||
" }\n" % (nullBehavior, undefinedBehavior))
|
||||
|
|
|
@ -262,7 +262,7 @@ public:
|
|||
Ptr()->~implementation_type();
|
||||
}
|
||||
|
||||
JSBool IsValid() { return mValid; }
|
||||
JSBool IsValid() const { return mValid; }
|
||||
|
||||
implementation_type *Ptr()
|
||||
{
|
||||
|
@ -270,12 +270,24 @@ public:
|
|||
return reinterpret_cast<implementation_type *>(mBuf);
|
||||
}
|
||||
|
||||
const implementation_type *Ptr() const
|
||||
{
|
||||
MOZ_ASSERT(mValid);
|
||||
return reinterpret_cast<const implementation_type *>(mBuf);
|
||||
}
|
||||
|
||||
operator interface_type &()
|
||||
{
|
||||
MOZ_ASSERT(mValid);
|
||||
return *Ptr();
|
||||
}
|
||||
|
||||
operator const interface_type &() const
|
||||
{
|
||||
MOZ_ASSERT(mValid);
|
||||
return *Ptr();
|
||||
}
|
||||
|
||||
/* Enum that defines how JS |null| and |undefined| should be treated. See
|
||||
* the WebIDL specification. eStringify means convert to the string "null"
|
||||
* or "undefined" respectively, via the standard JS ToString() operation;
|
||||
|
|
Загрузка…
Ссылка в новой задаче