1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

HackStudio: Implement custom JS -> C++ "proxy" objects

This patch adds a custom JS Object type that will convert written
properties to their C++ equivalents, reflecting JS writes back
to the debugging session. This is better than a simple proxy because
printing this custom object works as expected because properties
still exist on the object as existing handlers expect.
This commit is contained in:
FalseHonesty 2021-04-12 21:59:15 -04:00 committed by Linus Groh
parent 60d329a186
commit 4f2c0e9968
5 changed files with 111 additions and 36 deletions

View file

@ -23,7 +23,6 @@ public:
JS::Value get(const JS::PropertyName& name, JS::Value receiver, bool without_side_effects) const override;
bool put(const JS::PropertyName& name, JS::Value value, JS::Value receiver) override;
private:
Optional<JS::Value> debugger_to_js(const Debug::DebugInfo::VariableInfo&) const;
Optional<u32> js_to_debugger(JS::Value value, const Debug::DebugInfo::VariableInfo&) const;