dom/xbl/crashtests/set-field-bad-this.xhtml

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <html xmlns="http://www.w3.org/1999/xhtml">
     3 <head>
     4   <title>Gracefully handle setting a field on a bad |this|</title>
     6   <bindings xmlns="http://www.mozilla.org/xbl">
     7     <binding id="a">
     8       <implementation>
     9         <field name="f">17</field>
    10       </implementation>
    11     </binding>
    12   </bindings>
    14   <script type="application/javascript">
    15     window.onload = function()
    16     {
    17       var bound = document.getElementById("bound");
    18       try
    19       {
    20         Object.getPrototypeOf(bound).f = 42;
    21       }
    22       catch (e) { /* Throwing's fine, crashing isn't. */ }
    23     };
    24   </script>
    25 </head>
    27 <body>
    28   <div id="bound" style="-moz-binding: url(#a)"></div>
    29 </body>
    31 </html>

mercurial