mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 747815. Use const strings for arguments in DOM bindings. r=peterv
This commit is contained in:
parent
b38f6768b1
commit
4399ca73fe
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user