mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
LibJS: Add fast_is<T>() for FunctionDeclaration
This commit is contained in:
parent
2bf3a263c5
commit
527a6f4ded
1 changed files with 4 additions and 2 deletions
|
@ -69,6 +69,7 @@ public:
|
||||||
virtual bool is_identifier() const { return false; }
|
virtual bool is_identifier() const { return false; }
|
||||||
virtual bool is_scope_node() const { return false; }
|
virtual bool is_scope_node() const { return false; }
|
||||||
virtual bool is_program() const { return false; }
|
virtual bool is_program() const { return false; }
|
||||||
|
virtual bool is_function_declaration() const { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit ASTNode(SourceRange source_range)
|
explicit ASTNode(SourceRange source_range)
|
||||||
|
@ -378,8 +379,6 @@ public:
|
||||||
// 8.1.3 Static Semantics: IsConstantDeclaration, https://tc39.es/ecma262/#sec-static-semantics-isconstantdeclaration
|
// 8.1.3 Static Semantics: IsConstantDeclaration, https://tc39.es/ecma262/#sec-static-semantics-isconstantdeclaration
|
||||||
virtual bool is_constant_declaration() const { return false; }
|
virtual bool is_constant_declaration() const { return false; }
|
||||||
|
|
||||||
virtual bool is_function_declaration() const { return false; }
|
|
||||||
|
|
||||||
virtual bool is_lexical_declaration() const { return false; }
|
virtual bool is_lexical_declaration() const { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1787,4 +1786,7 @@ inline bool ASTNode::fast_is<ScopeNode>() const { return is_scope_node(); }
|
||||||
template<>
|
template<>
|
||||||
inline bool ASTNode::fast_is<Program>() const { return is_program(); }
|
inline bool ASTNode::fast_is<Program>() const { return is_program(); }
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool ASTNode::fast_is<FunctionDeclaration>() const { return is_function_declaration(); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue