mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
LibJS: Make class definition evaluation work in bytecode mode
Instead of assuming that there's an active AST interpreter, this code now takes VM& everywhere and invokes the appropriate interpreter. 92 new passes on test262. :^)
This commit is contained in:
parent
66936a0d61
commit
8450948458
4 changed files with 38 additions and 39 deletions
|
@ -1301,7 +1301,7 @@ public:
|
|||
|
||||
// We use the Completion also as a ClassStaticBlockDefinition Record.
|
||||
using ClassValue = Variant<ClassFieldDefinition, Completion, PrivateElement>;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const = 0;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(VM&, Object& home_object) const = 0;
|
||||
|
||||
virtual Optional<DeprecatedFlyString> private_bound_identifier() const { return {}; };
|
||||
|
||||
|
@ -1330,7 +1330,7 @@ public:
|
|||
virtual ElementKind class_element_kind() const override { return ElementKind::Method; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(VM&, Object& home_object) const override;
|
||||
virtual Optional<DeprecatedFlyString> private_bound_identifier() const override;
|
||||
|
||||
private:
|
||||
|
@ -1357,7 +1357,7 @@ public:
|
|||
virtual ElementKind class_element_kind() const override { return ElementKind::Field; }
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(VM&, Object& home_object) const override;
|
||||
virtual Optional<DeprecatedFlyString> private_bound_identifier() const override;
|
||||
|
||||
private:
|
||||
|
@ -1376,7 +1376,7 @@ public:
|
|||
}
|
||||
|
||||
virtual ElementKind class_element_kind() const override { return ElementKind::StaticInitializer; }
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(Interpreter&, Object& home_object) const override;
|
||||
virtual ThrowCompletionOr<ClassValue> class_element_evaluation(VM&, Object& home_object) const override;
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
|
||||
|
@ -1421,7 +1421,7 @@ public:
|
|||
|
||||
bool has_name() const { return !m_name.is_empty(); }
|
||||
|
||||
ThrowCompletionOr<ECMAScriptFunctionObject*> class_definition_evaluation(Interpreter&, DeprecatedFlyString const& binding_name = {}, DeprecatedFlyString const& class_name = {}) const;
|
||||
ThrowCompletionOr<ECMAScriptFunctionObject*> class_definition_evaluation(VM&, DeprecatedFlyString const& binding_name = {}, DeprecatedFlyString const& class_name = {}) const;
|
||||
|
||||
private:
|
||||
virtual bool is_class_expression() const override { return true; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue