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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xbl/crashtests/set-field-bad-this.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +
     1.6 +<head>
     1.7 +  <title>Gracefully handle setting a field on a bad |this|</title>
     1.8 +
     1.9 +  <bindings xmlns="http://www.mozilla.org/xbl">
    1.10 +    <binding id="a">
    1.11 +      <implementation>
    1.12 +        <field name="f">17</field>
    1.13 +      </implementation>
    1.14 +    </binding>
    1.15 +  </bindings>
    1.16 +
    1.17 +  <script type="application/javascript">
    1.18 +    window.onload = function()
    1.19 +    {
    1.20 +      var bound = document.getElementById("bound");
    1.21 +      try
    1.22 +      {
    1.23 +        Object.getPrototypeOf(bound).f = 42;
    1.24 +      }
    1.25 +      catch (e) { /* Throwing's fine, crashing isn't. */ }
    1.26 +    };
    1.27 +  </script>
    1.28 +</head>
    1.29 +
    1.30 +<body>
    1.31 +  <div id="bound" style="-moz-binding: url(#a)"></div>
    1.32 +</body>
    1.33 +
    1.34 +</html>

mercurial