mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
104442 - Part 1: Report the position and the kind of previous declaration for redeclaration error.
This commit is contained in:
parent
e48044fc01
commit
006b0f5d17
5 changed files with 330 additions and 35 deletions
|
|
@ -146,9 +146,9 @@ class ParseContext : public Nestable<ParseContext>
|
|||
}
|
||||
|
||||
MOZ_MUST_USE bool addDeclaredName(ParseContext* pc, AddDeclaredNamePtr& p, JSAtom* name,
|
||||
DeclarationKind kind)
|
||||
DeclarationKind kind, uint32_t pos)
|
||||
{
|
||||
return maybeReportOOM(pc, declared_->add(p, name, DeclaredNameInfo(kind)));
|
||||
return maybeReportOOM(pc, declared_->add(p, name, DeclaredNameInfo(kind, pos)));
|
||||
}
|
||||
|
||||
// Remove all VarForAnnexBLexicalFunction declarations of a certain
|
||||
|
|
@ -1437,15 +1437,17 @@ class Parser final : public ParserBase, private JS::AutoGCRooter
|
|||
|
||||
bool hasValidSimpleStrictParameterNames();
|
||||
|
||||
void reportRedeclaration(HandlePropertyName name, DeclarationKind kind, TokenPos pos);
|
||||
bool notePositionalFormalParameter(Node fn, HandlePropertyName name,
|
||||
void reportRedeclaration(HandlePropertyName name, DeclarationKind prevKind, TokenPos pos,
|
||||
uint32_t prevPos);
|
||||
bool notePositionalFormalParameter(Node fn, HandlePropertyName name, uint32_t beginPos,
|
||||
bool disallowDuplicateParams, bool* duplicatedParam);
|
||||
bool noteDestructuredPositionalFormalParameter(Node fn, Node destruct);
|
||||
mozilla::Maybe<DeclarationKind> isVarRedeclaredInEval(HandlePropertyName name,
|
||||
DeclarationKind kind);
|
||||
bool tryDeclareVar(HandlePropertyName name, DeclarationKind kind,
|
||||
mozilla::Maybe<DeclarationKind>* redeclaredKind);
|
||||
bool tryDeclareVarForAnnexBLexicalFunction(HandlePropertyName name, bool* tryAnnexB);
|
||||
bool tryDeclareVar(HandlePropertyName name, DeclarationKind kind, uint32_t beginPos,
|
||||
mozilla::Maybe<DeclarationKind>* redeclaredKind, uint32_t* prevPos);
|
||||
bool tryDeclareVarForAnnexBLexicalFunction(HandlePropertyName name, uint32_t beginPos,
|
||||
bool* tryAnnexB);
|
||||
bool checkLexicalDeclarationDirectlyWithinBlock(ParseContext::Statement& stmt,
|
||||
DeclarationKind kind, TokenPos pos);
|
||||
bool noteDeclaredName(HandlePropertyName name, DeclarationKind kind, TokenPos pos);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue