mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibJS: Parse FunctionExpressions
FunctionExpression is mostly like FunctionDeclaration, except the name is optional. Share the parsing logic in parse_function_node<NodeType>. This allows us to do nice things like: document.addEventListener("DOMContentLoaded", function() { alert("Hello friends!"); });
This commit is contained in:
parent
b1b4c9844e
commit
07679e347c
Notes:
sideshowbarker
2024-07-19 08:14:55 +09:00
Author: https://github.com/awesomekling
Commit: 07679e347c
3 changed files with 21 additions and 5 deletions
|
@ -43,10 +43,12 @@ public:
|
|||
|
||||
NonnullRefPtr<Program> parse_program();
|
||||
|
||||
template<typename FunctionNodeType>
|
||||
NonnullRefPtr<FunctionNodeType> parse_function_node();
|
||||
|
||||
NonnullRefPtr<Statement> parse_statement();
|
||||
NonnullRefPtr<BlockStatement> parse_block_statement();
|
||||
NonnullRefPtr<ReturnStatement> parse_return_statement();
|
||||
NonnullRefPtr<FunctionDeclaration> parse_function_declaration();
|
||||
NonnullRefPtr<VariableDeclaration> parse_variable_declaration();
|
||||
NonnullRefPtr<ForStatement> parse_for_statement();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue