Bug 821116 - Track line numbers for XBL properties (r=bz)

This commit is contained in:
Bill McCloskey 2012-12-17 12:22:38 -08:00
Родитель 3e75d1968f
Коммит 41af605210
4 изменённых файлов: 14 добавлений и 8 удалений

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

@ -487,7 +487,7 @@ nsXBLContentSink::OnOpenContainer(const PRUnichar **aAtts,
mSecondaryState == eXBL_None);
NS_ASSERTION(mBinding, "Must have binding here");
mSecondaryState = eXBL_InProperty;
ConstructProperty(aAtts);
ConstructProperty(aAtts, aLineNumber);
}
else if (aTagName == nsGkAtoms::getter) {
ENSURE_XBL_STATE(mSecondaryState == eXBL_InProperty && mProperty);
@ -770,7 +770,7 @@ nsXBLContentSink::ConstructField(const PRUnichar **aAtts, uint32_t aLineNumber)
}
void
nsXBLContentSink::ConstructProperty(const PRUnichar **aAtts)
nsXBLContentSink::ConstructProperty(const PRUnichar **aAtts, uint32_t aLineNumber)
{
const PRUnichar* name = nullptr;
const PRUnichar* readonly = nullptr;
@ -805,7 +805,7 @@ nsXBLContentSink::ConstructProperty(const PRUnichar **aAtts)
if (name) {
// All of our pointers are now filled in. Construct our property with all of
// these parameters.
mProperty = new nsXBLProtoImplProperty(name, onget, onset, readonly);
mProperty = new nsXBLProtoImplProperty(name, onget, onset, readonly, aLineNumber);
if (mProperty) {
AddMember(mProperty);
}

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

@ -107,7 +107,7 @@ protected:
void ConstructHandler(const PRUnichar **aAtts, uint32_t aLineNumber);
void ConstructResource(const PRUnichar **aAtts, nsIAtom* aResourceType);
void ConstructImplementation(const PRUnichar **aAtts);
void ConstructProperty(const PRUnichar **aAtts);
void ConstructProperty(const PRUnichar **aAtts, uint32_t aLineNumber);
void ConstructMethod(const PRUnichar **aAtts);
void ConstructParameter(const PRUnichar **aAtts);
void ConstructField(const PRUnichar **aAtts, uint32_t aLineNumber);

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

@ -18,7 +18,8 @@
nsXBLProtoImplProperty::nsXBLProtoImplProperty(const PRUnichar* aName,
const PRUnichar* aGetter,
const PRUnichar* aSetter,
const PRUnichar* aReadOnly) :
const PRUnichar* aReadOnly,
uint32_t aLineNumber) :
nsXBLProtoImplMember(aName),
mGetterText(nullptr),
mSetterText(nullptr),
@ -35,10 +36,14 @@ nsXBLProtoImplProperty::nsXBLProtoImplProperty(const PRUnichar* aName,
mJSAttributes |= JSPROP_READONLY;
}
if (aGetter)
if (aGetter) {
AppendGetterText(nsDependentString(aGetter));
if (aSetter)
SetGetterLineNumber(aLineNumber);
}
if (aSetter) {
AppendSetterText(nsDependentString(aSetter));
SetSetterLineNumber(aLineNumber);
}
}
nsXBLProtoImplProperty::nsXBLProtoImplProperty(const PRUnichar* aName,

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

@ -20,7 +20,8 @@ public:
nsXBLProtoImplProperty(const PRUnichar* aName,
const PRUnichar* aGetter,
const PRUnichar* aSetter,
const PRUnichar* aReadOnly);
const PRUnichar* aReadOnly,
uint32_t aLineNumber);
nsXBLProtoImplProperty(const PRUnichar* aName, const bool aIsReadOnly);