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

Re: Custom elements ES6/ES5 syntax compromise, was: document.register and ES6

From: Erik Arvidsson <arv@chromium.org>
Date: Thu, 14 Feb 2013 17:15:55 -0500
Message-ID: <CAJ8+GojmXfo+V4tNdPHsMhM2AkANNdUKe_uLQcXa4e35TYLALA@mail.gmail.com>
To: Rick Waldron <waldron.rick@gmail.com>
Cc: Dimitri Glazkov <dglazkov@google.com>, public-webapps <public-webapps@w3.org>, Scott Miles <sjmiles@google.com>, Daniel Buchner <daniel@mozilla.com>, Boris Zbarsky <bzbarsky@mit.edu>, Anne van Kesteren <annevk@annevk.nl>
Yeah, this post does not really talk about syntax. It comes after a
discussion how we could use ES6 class syntax.

The ES6 classes have the same semantics as provided in this thread using
ES5.

On Thu, Feb 14, 2013 at 5:10 PM, Rick Waldron <waldron.rick@gmail.com>wrote:

>
> On Thu, Feb 14, 2013 at 4:48 PM, Dimitri Glazkov <dglazkov@google.com>wrote:
>
>>
>> MyButton = document.register(‘x-button’, {
>>   prototype: MyButton.prototype,
>>   lifecycle: {
>>      created: MyButton
>>   }
>> });
>>
>
>
> Does this actually mean that the second argument has a property called
> "prototype" that itself has a special meaning?
>

This is just a dictionary.


>
> Is the re-assignment MyButton intentional? I see the original "MyButton"
> reference as the value of the created property, but then
> document.register's return value is assigned to the same identifier? Maybe
> this was a typo?
>
>>
>> document.register(‘x-button’, {
>>  constructor: MyButton,
>>  ...
>> });
>>
>>
> Same question as above, but re: "constructor"?
>
>
Same answer here.

I'm not happy with these names but I can't think of anything better.

-- 
erik
Received on Thursday, 14 February 2013 22:16:44 GMT

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