Make With objects non-native




JavaScript Engine
8 years ago
4 years ago


(Reporter: jorendorff, Unassigned)


Other Branch

Firefox Tracking Flags

(Not tracked)




8 years ago
I was shocked to discover today that With objects are native. Even mrbkap was surprised.

As with XML objects (see bug 560101 comment 8), With objects have a shape but do not support the shape guarantees. Fortunately they aren't exposed to scripts, and while they're on the scope chain the property cache and JIT are disabled. So no known correctness bug here, just general outrage.
With objects are so old there wasn't any notion of "non-native" -- no JSObjectOps, no LiveConnect, none of that.

But yeah: outrageous!


Comment 2

8 years ago
Brendan, if we make with non-native we will have non-native objects on the scope chain. What gives?
What a predicament! Srsly, we could either make With non-native but tolerate it as a special case, or leave it native and do something stronger to defend against it being shapeless -- or could we keep it native and give it its proto's shape?

Jason, aren't With objects empty in shape terms? Each with its own proto, the empty shape for a given With object must depend on proto identity.


Comment 5

8 years ago
With objects never have any own properties, so I don't think it hurts if they are non-native.


4 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.