archives

« Bugzilla Issues Index

#1191 — [[SetInheritance]] directly accesses [[Extensible]]


[[SetInheritance]] directly accesses [[Extensible]] instead of using [[IsExtensible]].


This is also in OrdinaryDefineOwnProperty.


Yes, this was intentional. The idea being that since we are specifically defining an internal method of ordinary objects, we can use full knowledge of the design of ordinary object. This includes knowledge of what calling [[IsExtensible]] would do.

To put it more concretely, because we know how the call to [[IsExtensible]] will be dispatched we can manually in-line it.

There is a tension here between over-specification and maintainability of the spec. I don't particularly want to suggest that a polymorphic internal method dispatch is required to check the extensible flag. However, in-lining creates duplicate pseudo-code that can lead to spec. bugs. This is why I define things like OrdinaryGetOwnProperty. In the case of a one liner like testing the extensible flag that seems like overkill.