Re: [webcomponents] Large custom element spec rewrite to implement some F2F decisions (#405)

> -        <li>Return <var>ELEMENT</var>.</li>
> -    </ol></li>
> -    <li>Call <code><a href="https://tc39.github.io/ecma262/#sec-definepropertyorthrow">DefinePropertyOrThrow</a>(</code><var>FUNCTION</var><code>, @@create, PropertyDescriptor{[[\Value]]: </code><var>CREATE</var><code>, [[\Writable]]: false, [[\Enumerable]]: false, [[\Configurable]]: false})</code></li>
> -    <li>Return <var>FUNCTION</var>.</li>
> +    <li>Let <var>C</var> be <var>definition</var>'s <a href="#dfn-element-definition-constructor">constructor</a>.</li>
> +
> +    <li>Let <var>constructResult</var> be <a href="https://tc39.github.io/ecma262/#sec-construct">Construct</a>(<var>C</var>).</li>
> +
> +    <li>Remove <var>element</var> from the end of <var>definition</var>'s <a href="#dfn-element-definition-construction-stack">construction stack</a>.</li>
> +
> +    <li>If <var>constructResult</var> is an abrupt completion, return <var>constructResult</var> (i.e., re-throw the exception).</li>
> +
> +    <li>
> +        <p>If <a href="https://tc39.github.io/ecma262/#sec-samevalue">SameValue</a>(<var>constructResult</var>.[[\value]], <var>element</var>) is false, <a href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code>InvalidStateError</code> and terminate these steps.</p>
> +
> +        <p class="note">This can occur if <var>C</var> constructs another instance of the same custom element before calling <code>super()</code>.</p>

Or the constructor returns a random object e.g. {}.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/pull/405/files#r54660827

Received on Wednesday, 2 March 2016 00:28:04 UTC