archives

« Bugzilla Issues Index

#3840 — IsArray, IsCallable, IsConstructor, IsRegExp should all throw when used on a revoked proxy, just like Object.isExtensible does


Revoked proxies throw on attempts to examine them, touch them, &c. This should include yes-or-no queries about their internal natures, including all the ones in the summary. Currently they're inconsistent: IsRegExp throws, IsArray returns false, IsCallable and IsConstructor return the nature of the original target of the proxy.

It's also worth noting that Object.isExtensible throws on a revoked proxy. It seems pretty clear that if the other predicates noted consulted traps (as only IsRegExp does right now), they would throw for that reason. Seems like everything should throw. (And for what it's worth, SpiderMonkey's dead-object/membrane precedent is for these things to throw, too, as I recall.)


fixed in rev33 editor's draft

Fixed IsArray, GetFunctionRealm to throw when applied to a revoked proxy. Also made ProxyCreate throw if either the handler or target object is a direct proxy.

As far as I can see, those are the only remaining places that drill through a proxy and didn't either explicitly or implicitly (via internal method calls check for revocation.

I don't want to make IsCallable and IsConstructor throw because they are used too many places within the spec. as direct predicates of an if and hence don't have a subsequent ReturnIfAbrupt check. It looks to me, that those uses will generally detect revoked proxies because they ultimately do something that invokes an internal method. Let me know if you see any that don't


fixed in rev33