summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-04-06 07:30:00 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-04-06 07:30:00 +0200
commitf5c293d3e82581740558c79cf752bccc0420199c (patch)
tree21bb36655f375413043aa779231627fabf0c3bd4 /js
parent4c4f8091e620a35d6d20a5b0ccc6c118e9b8e5e5 (diff)
downloadUXP-f5c293d3e82581740558c79cf752bccc0420199c.tar
UXP-f5c293d3e82581740558c79cf752bccc0420199c.tar.gz
UXP-f5c293d3e82581740558c79cf752bccc0420199c.tar.lz
UXP-f5c293d3e82581740558c79cf752bccc0420199c.tar.xz
UXP-f5c293d3e82581740558c79cf752bccc0420199c.zip
Report bad-class-member errors using a specified offset instead of a node's offset.
Diffstat (limited to 'js')
-rw-r--r--js/src/frontend/Parser.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index 0099ed19d..2702f3075 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -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();
}