W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: document.register and ES6

From: Erik Arvidsson <arv@chromium.org>
Date: Wed, 6 Feb 2013 16:45:21 -0500
Message-ID: <CAJ8+GoissEip8Siag2Lq2yMcJ0hTfcKKM4h8XCGqg1t6LyCCRQ@mail.gmail.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:57 GMT