<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Problem with ES6 class definition inside of function definition"
   href="https://bugs.webkit.org/show_bug.cgi?id=151365">151365</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Problem with ES6 class definition inside of function definition
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari 9
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Mac OS X 10.10
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>danfuzz&#64;milk.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When using the ES6 class definition syntax in the scope of a function, it looks like static definitions might not quite work. I am not 100% sure what the exact trigger is, but I do have a case right now that consistently fails.

Steps to Reproduce:
1. Open Safari.
2. Visit &lt;<a href="http://milk.com/mimu/awkward-js-music/">http://milk.com/mimu/awkward-js-music/</a>&gt;.

Expected Results:
Embedded canvases should be rendered, and &quot;play / pause&quot; button should work.

Actual Results:
Message to console: &quot;ReferenceError: Can't find variable: StyleUtil -- cloneComputedStyle -- StyleUtil.js:39&quot;

Notably, the line that is being complained about is within the definition of the class StyleUtil. Given that cloneComputedStyle does exist in that class, the lookup should not ever fail.

I'm continuing development of the code. Here's a snapshot of the source as of this report: &lt;<a href="https://github.com/danfuzz/mimu/tree/6042dc4014211eed2ba75354e5ed5361b998f07a">https://github.com/danfuzz/mimu/tree/6042dc4014211eed2ba75354e5ed5361b998f07a</a>&gt;

Three items of note:

* This bug showed up after I wrapped the definition of the class in a function definition (as part of a conversion to RequireJS).
* The code as currently written works in Chrome. It doesn't work in FireFox in that FireFox doesn't do the ES6 class syntax at all yet (at least not in the release build).
* If you clone the source locally and view the index.html file in Safari, then *sometimes* the bug will show up, and sometimes the page will operate properly.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>