mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-30 19:28:40 +09:00
Report bad-class-member errors using a specified offset instead of a node's offset.
This commit is contained in:
parent
f1f8d377a9
commit
42d2e161db
1 changed files with 4 additions and 4 deletions
|
|
@ -6673,7 +6673,7 @@ Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
|
|||
propType != PropertyType::AsyncMethod &&
|
||||
propType != PropertyType::Constructor && propType != PropertyType::DerivedConstructor)
|
||||
{
|
||||
error(JSMSG_BAD_METHOD_DEF);
|
||||
errorAt(nameOffset, JSMSG_BAD_METHOD_DEF);
|
||||
return null();
|
||||
}
|
||||
|
||||
|
|
@ -6683,17 +6683,17 @@ Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
|
|||
propType = PropertyType::SetterNoExpressionClosure;
|
||||
if (!isStatic && propAtom == context->names().constructor) {
|
||||
if (propType != PropertyType::Method) {
|
||||
reportWithNode(ParseError, false, propName, JSMSG_BAD_METHOD_DEF);
|
||||
errorAt(nameOffset, JSMSG_BAD_METHOD_DEF);
|
||||
return null();
|
||||
}
|
||||
if (seenConstructor) {
|
||||
reportWithNode(ParseError, false, propName, JSMSG_DUPLICATE_PROPERTY, "constructor");
|
||||
errorAt(nameOffset, JSMSG_DUPLICATE_PROPERTY, "constructor");
|
||||
return null();
|
||||
}
|
||||
seenConstructor = true;
|
||||
propType = hasHeritage ? PropertyType::DerivedConstructor : PropertyType::Constructor;
|
||||
} else if (isStatic && propAtom == context->names().prototype) {
|
||||
reportWithNode(ParseError, false, propName, JSMSG_BAD_METHOD_DEF);
|
||||
errorAt(nameOffset, JSMSG_BAD_METHOD_DEF);
|
||||
return null();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue