This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22192 - [Custom]: Perhaps element's last completion value should not be from an exceptional termination?
Summary: [Custom]: Perhaps element's last completion value should not be from an excep...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18719
  Show dependency treegraph
 
Reported: 2013-05-29 05:45 UTC by Dominic Cooney
Modified: 2013-05-29 21:06 UTC (History)
0 users

See Also:


Attachments

Description Dominic Cooney 2013-05-29 05:45:31 UTC
"Let PROPERTIES be DOCUMENT's last completion value"

I think 'throw' establishes a completion value, so for example this:

<element name="sur-prise">
  <template>...</template>
  <script>
    var t = document.currentScript.parentElement.querySelectorAll('template');
    var defensiveCopy = t.content.cloneNode();
    ({
      readyCallback: function () {
        var root = this.createShadowRoot();
        root.appendChild(defensiveCopy.cloneNode());
      }
    });
  </script>
</element>

Will create a Custom Element with a prototype with 'message' and 'stack' because those are the own properties of the exception generated at t.content.cloneNode (because I "accidentally" did querySelectorAll instead of querySelector, so t is a NodeList and t.content is undefined; undefined.cloneNode() throws; etc.)

Maybe custom element processing should not set up this funkified prototype if the script exits with an error exit?
Comment 1 Dimitri Glazkov 2013-05-29 21:06:06 UTC
Good point!

https://dvcs.w3.org/hg/webcomponents/rev/29a89e926f94