mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-01 15:18:06 +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:
parent
e5adc51e27
commit
3a8dd3e78d
Notes:
sideshowbarker
2024-07-17 08:10:00 +09:00
Author: https://github.com/davidot
Commit: 3a8dd3e78d
Pull-request: https://github.com/SerenityOS/serenity/pull/14904
Reviewed-by: https://github.com/linusg
3 changed files with 141 additions and 24 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue