1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

Shell: Allow lossy conversion from list -> string in POSIX mode

Similar to bash, this operation returns only the first element because
reasons.
This commit is contained in:
Ali Mohammad Pur 2023-04-19 12:16:45 +03:30 committed by Ali Mohammad Pur
parent 8a042cd9cb
commit 71441ea932
2 changed files with 12 additions and 0 deletions

View file

@ -310,6 +310,7 @@ private:
class ListValue final : public Value {
public:
virtual ErrorOr<Vector<String>> resolve_as_list(RefPtr<Shell>) override;
virtual ErrorOr<String> resolve_as_string(RefPtr<Shell>) override;
virtual ErrorOr<NonnullRefPtr<Value>> resolve_without_cast(RefPtr<Shell>) override;
virtual ErrorOr<NonnullRefPtr<Value>> clone() const override { return TRY(try_make_ref_counted<ListValue>(m_contained_values))->set_slices(m_slices); }
virtual ~ListValue();