W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Re: Custom Elements: Upgrade et al

From: Domenic Denicola <d@domenic.me>
Date: Thu, 7 May 2015 17:23:10 +0000
To: Anne van Kesteren <annevk@annevk.nl>, Ryosuke Niwa <rniwa@apple.com>
CC: Dimitri Glazkov <dglazkov@google.com>, WebApps WG <public-webapps@w3.org>
Message-ID: <1431019388605.69451@domenic.me>
From: Anne van Kesteren <annevk@annevk.nl>

> No, I'm saying there would be another primitive operation, similar to the extended structured cloning proposed elsewhere, to accomplish cloning without side effects.

You are referring to https://github.com/dslomov-chromium/ecmascript-structured-clone ? That invokes the constructors. (It uses the imprecise ES5-era "let output be a new Array..." language, but if upgraded to ES6 that becomes "let output be Construct(%Array%, 0)", and similar.)

There's really no way to get objects of the right class without either:

1. Invoking the constructor; or
2. Proto-swizzling an object that was allocated without using the constructor.

2 is broken in many ways if we allow user-defined constructors. (This is is why the "Dmitry proposal" specifically disallows user-defined constructors, in favor of inheriting the HTMLElement constructor.)

So is your proposal 1 or 2?
Received on Thursday, 7 May 2015 17:23:41 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC