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

LibJS: Add Uint8ClampedArray :^)

This is a special kind of byte array that clamps its values to 0...255
It will be used for HTML ImageData objects.

I made Object::put_by_index() and get_by_index() virtual for this.
We'll probably need to make non-numeric property name lookups virtual
as well, but this solves my current problem well enough.
This commit is contained in:
Andreas Kling 2020-04-21 23:46:51 +02:00
parent 0fa7cf70b5
commit 627fd6374b
5 changed files with 144 additions and 2 deletions

View file

@ -46,11 +46,11 @@ public:
Shape& shape() { return *m_shape; }
const Shape& shape() const { return *m_shape; }
Optional<Value> get_by_index(i32 property_index) const;
virtual Optional<Value> get_by_index(i32 property_index) const;
Optional<Value> get(const FlyString& property_name) const;
Optional<Value> get(PropertyName) const;
void put_by_index(i32 property_index, Value);
virtual void put_by_index(i32 property_index, Value);
void put(const FlyString& property_name, Value);
void put(PropertyName, Value);