1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:07:45 +00:00

LibJS: Implement tagged literals evaluation like the spec

We cache on the AST node side as this is easier to track a position, we
just have to take care to wrap the values in a handle to make sure they
are not garbage collected.
This commit is contained in:
davidot 2022-08-17 21:29:23 +02:00 committed by Linus Groh
parent e5adc51e27
commit 3a8dd3e78d
3 changed files with 141 additions and 24 deletions

View file

@ -1769,9 +1769,12 @@ public:
virtual void dump(int indent) const override;
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
ThrowCompletionOr<Value> get_template_object(Interpreter& interpreter, GlobalObject& global_object) const;
private:
NonnullRefPtr<Expression> const m_tag;
NonnullRefPtr<TemplateLiteral> const m_template_literal;
mutable HashMap<Realm*, Handle<Array>> m_cached_values;
};
class MemberExpression final : public Expression {