Description
This would be a breaking change, but, I think, Object.keys
, Object.entries
, Object.setPrototypeOf
etc. need to be changed to somehow support prototype-less objects.
In JavaScript it's common to have object values without prototype used as dictionaries created by either Object.create(null)
or a corresponding literal form { __proto__: null, ... }
.
These don't have Object
in their prototype chain, so you can't call methods from Object.prototype
on them (e.g. .to_string()
won't work), and dyn_ref
fails as expected.
However, you should still be able to call Object.keys
, Object.values
, Object.seal
and other static methods, because they support such objects as well as any others.
So we need to somehow separate these two types to allow arbitrary objects in static methods, and only prototyped objects in methods that accept &self
/ &this
.