noSuchMethod: "funargs" + "invoke-only-phantoms"

Tom Van Cutsem tomvc.be at gmail.com
Tue Dec 20 05:00:24 PST 2011


>
> - @Tom: Found bugs in DirectProxies.js
>

Thanks for reporting, but I don't think these are bugs:


>    1. Properties created via assignment gets `false' value for descriptor
> attributes; should be true. E.g. foo.bar = 10, where `foo' is direct proxy,
> makes bar non-configurable
>

I can't reproduce this. Both in tracemonkey and ff8 I get the following:

js> var t = {}
js> var p = Proxy(t, {})
js> p.x = 1
1
js> Object.getOwnPropertyDescriptor(t, 'x')
({value:1, writable:true, enumerable:true, configurable:true})
js> Object.getOwnPropertyDescriptor(p, 'x')
({value:1, writable:true, enumerable:true, configurable:true})

There is, however, a TM-specific bug that I suspect may be the cause of
your observed "non-configurable by default" behavior: <
https://bugzilla.mozilla.org/show_bug.cgi?id=601329>

   2. Can't return descriptor with `configurable: false' for non-existing
> property; get: "cannot report a non-configurable descriptor for
> non-existent property" But we need it in case virtual methods
>

You can (and probably should) advertise a virtual method as
configurable:true.

The proxy throws this exception because, for properties that do not exist
on the wrapped target, it cannot guarantee that they will always be
non-configurable. For example, if your proxy handler now says that "foo" is
{value:10, configurable:false}, nothing stops your proxy handler from later
claiming that "foo" is {value:0, configurable:true}.

Cheers,
Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111220/c9e11726/attachment.html>


More information about the es-discuss mailing list