Open domenic opened 6 years ago
Things which do not use any internal slots/brand checks and can thus be emulated in user code
we can discuss in #8, but i feel like this is the one part i'm confused about. The goal of "Usage does not make refactoring prototype chains over time more likely to break the web" is entirely unrelated to the existence of brand checks in the underlying implementations - it seems like that goal requires also covering builtin things that can be implemented in user code.
I agree it's unrelated.
So doesn't that non-goal implicitly thus become a goal?
No, they're unrelated, so that goal has no impact on the non-goal.
… ok so that's still the part i'm confused about. In order to achieve the goal of "Usage does not make refactoring prototype chains over time more likely to break the web", wouldn't "originals" need to be available for all prototype methods, not just ones with brand checks, since the web will (and already does) rely on builtin methods irrespective of whether they perform brand checks or not?
I'd suggest taking this discussion to another issue. In particular I'd suggest starting with code that would be written using a version of get-originals which does not work on e.g. Array.prototype.map (per the non-goal) but which would somehow cause the web to break.
+@koto
Goals should include not undoing the work of polyfills like https://github.com/WICG/trusted-types which need to patch setters and some getters on element prototypes to gate access to browser builtins.
The pattern of trusting early running code to set up bounds for late running code is a well-established one, and breaking this would make it harder for security engineers to do their jobs.
+1 to what mikesamuel@ said. For runtime-enforced security, it's necessary to be able to constrain later running code, and the features as described here would make that impossible.
Let me suggest constraining your discussions to other threads, so we can use this for the design goals of the proposal authors. I'll collapse a number of comments here.
As previous issues in this tracker plus other offline discussions have revealed, my hypotheses as to what would be implementable are not very good. As such the API currently in the README is not a great representation of what we're trying to accomplish here, as it mixes up the problem space with the solution space.
Here's my first draft of goals and non-goals that should help make things clearer for anyone, like myself, who wants to rethink the solution space.
Goals
Non-goals
It is also a non-goal to support a way of stashing and retrieving the originals for user-supplied objects, although that would be vaguely nice if it falls out naturally from the design we end up with. (Related: https://github.com/drufball/layered-apis/issues/32)