1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +00:00

LibJS: Remove is_use_strict_directive for all StringLiterals

This value was only used in the parser so no need to have this in every
string literal in the ast.
This commit is contained in:
davidot 2022-11-27 02:21:25 +01:00 committed by Linus Groh
parent 3c68a6684e
commit 3acbd96851
2 changed files with 4 additions and 9 deletions

View file

@ -1119,10 +1119,9 @@ private:
class StringLiteral final : public Literal {
public:
explicit StringLiteral(SourceRange source_range, String value, bool is_use_strict_directive = false)
explicit StringLiteral(SourceRange source_range, String value)
: Literal(source_range)
, m_value(move(value))
, m_is_use_strict_directive(is_use_strict_directive)
{
}
@ -1131,13 +1130,11 @@ public:
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
StringView value() const { return m_value; }
bool is_use_strict_directive() const { return m_is_use_strict_directive; };
private:
virtual bool is_string_literal() const override { return true; }
String m_value;
bool m_is_use_strict_directive;
};
class NullLiteral final : public Literal {