ruby.wasm
ruby.wasm copied to clipboard
JS::Object inherits BasicObject
The original motivation was to make it easier to call the JavaScript WebSocket#send method.
To achieve this, the following three methods were considered.
- Undefine the Object#send method
- Override the Object#send method
- Stop inheriting from the Object class
I was attracted by the fact that it clearly defines the role of the JS::Object class as a class that wraps JavaScript objects. I adopted the third method.
You can see past challenges at https://github.com/ruby/ruby.wasm/pull/509.
The following issues currently exist.
- The definition of the respond_to? method, which is only used in tests, cannot be removed.