diff options
author | davidot <davidot@serenityos.org> | 2021-11-27 00:01:23 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-30 17:05:32 +0000 |
commit | b7c7d54167d8c743cf91975fd3f073b65290b469 (patch) | |
tree | 2c1c5f59041a6de4c14243448f7cdd19a34b1f40 /Userland/Libraries/LibJS/Parser.h | |
parent | 22174d3b7bb2c7b4516a937d0ebbe28391f2b55e (diff) | |
download | serenity-b7c7d54167d8c743cf91975fd3f073b65290b469.zip |
LibJS: Split parsing program to script and module separately
This allows us to only perform checks like export bindings existing only
for modules. Also this makes it easier to set strict and other state
variables with TemporaryChanges.
Diffstat (limited to 'Userland/Libraries/LibJS/Parser.h')
-rw-r--r-- | Userland/Libraries/LibJS/Parser.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Parser.h b/Userland/Libraries/LibJS/Parser.h index 60a767b2c0..7153f36aa9 100644 --- a/Userland/Libraries/LibJS/Parser.h +++ b/Userland/Libraries/LibJS/Parser.h @@ -176,6 +176,9 @@ public: private: friend class ScopePusher; + void parse_script(Program& program, bool starts_in_strict_mode); + void parse_module(Program& program); + Associativity operator_associativity(TokenType) const; bool match_expression() const; bool match_unary_prefixed_expression() const; |