<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 - Cannot access the SQLTransaction.constructor.prototype"
   href="https://bugs.webkit.org/show_bug.cgi?id=156613">156613</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Cannot access the SQLTransaction.constructor.prototype
          </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>OS X 10.11
          </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>WebCore Misc.
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>d.camata&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In any other browser, I can access and modify SQLTransaction.constructor.prototype, like this:

<span class="quote">&gt; var db = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024);</span >
&lt; undefined
<span class="quote">&gt; db.transaction(function (tx) { console.log(tx.constructor.prototype) });</span >
&lt; undefined
-&gt; SQLTransaction {Symbol(Symbol.toStringTag): &quot;SQLTransaction&quot;}

The reason I do this is mostly to add a sinonjs spy to the executeSql method for some tests. 

But when I try to do this with Safari I get a &quot;TypeError: Attempted to wrap undefined property executeSql as function&quot;. I investigated a little bit and I saw that when I run this code inside Safari I don't get anything logged to my console. These are the options I tried:

<span class="quote">&gt; db.transaction(function (tx) { console.log(tx.constructor.prototype) });</span >
&lt; undefined
<span class="quote">&gt; db.transaction(function (tx) { console.log(tx.constructor) });</span >
&lt; undefined
<span class="quote">&gt; db.transaction(function (tx) { console.log(tx) });</span >
&lt; undefined

This is very awkward. All these examples works flawlessly in other browsers. Then I tried to get the transaction outside from the function, just for curiosity and I noticed something even more weird:

<span class="quote">&gt; db.transaction(function (tx) { global_transaction = tx });</span >
&lt; undefined
<span class="quote">&gt; global_transaction.constructor</span >
&lt; function Object() {
    [native code]
} = $3
<span class="quote">&gt; global_transaction.constructor.prototype</span >
&lt; {} = $2

Now I can access the constructor, but the prototype is empty. Because of this I can't properly test my code, which uses a lot of webSQL. 

Do you think this also has some interference with IndexedDB? Exactly ALL my tests using IndexedDB fails only on Safari too, but I still have to debug them a little bit more to correctly understand what is going on. 

Note: this is my first bug report here, so if it's not good enough feel free to give suggestions on how to improve it. Thanks!</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>