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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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