- From: Erik Arvidsson <arv@chromium.org>
- Date: Wed, 6 Feb 2013 16:45:21 -0500
- To: Daniel Buchner <daniel@mozilla.com>
- Cc: Scott Miles <sjmiles@google.com>, Dimitri Glazkov <dglazkov@google.com>, public-webapps <public-webapps@w3.org>, Boris Zbarsky <bzbarsky@mit.edu>
On Wed, Feb 6, 2013 at 4:27 PM, Daniel Buchner <daniel@mozilla.com> wrote: > So you're directly setting the user-added methods on matched elements in > browsers that don't support proto, but what about accessors? > > If we modified the spec (as previously suggested) to take an *unbaked* > prototype object, we could polyfill all property types: Just use the dedicated syntax. Using property descriptor is an anti pattern. We must not expose new APIs that PDs. > > var myButton = document.register('x-mybutton', { > prototype: { > foo: { > set: function(){ ... }, > get: function(){ ... } > } > } > }); var myButton = document.register('x-mybutton', { prototype: { get foo() { ... }, set foo(v) { ... } } }); -- erik
Received on Wednesday, 6 February 2013 21:46:12 UTC