<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><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#c1">Comment # 1</a>
              on <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">bug 156613</a>
              from <span class="vcard"><a class="email" href="mailto:beidson&#64;apple.com" title="Brady Eidson &lt;beidson&#64;apple.com&gt;"> <span class="fn">Brady Eidson</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=156613#c0">comment #0</a>)
<span class="quote">&gt; In any other browser, I can access and modify
&gt; SQLTransaction.constructor.prototype, like this:
&gt; 
&gt; &gt; var db = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024);
&gt; &lt; undefined
&gt; &gt; db.transaction(function (tx) { console.log(tx.constructor.prototype) });
&gt; &lt; undefined
&gt; -&gt; SQLTransaction {Symbol(Symbol.toStringTag): &quot;SQLTransaction&quot;}
&gt; 
&gt; The reason I do this is mostly to add a sinonjs spy to the executeSql method
&gt; for some tests. 
&gt; 
&gt; But when I try to do this with Safari I get a &quot;TypeError: Attempted to wrap
&gt; undefined property executeSql as function&quot;. I investigated a little bit and
&gt; I saw that when I run this code inside Safari I don't get anything logged to
&gt; my console. These are the options I tried:
&gt; 
&gt; &gt; db.transaction(function (tx) { console.log(tx.constructor.prototype) });
&gt; &lt; undefined
&gt; &gt; db.transaction(function (tx) { console.log(tx.constructor) });
&gt; &lt; undefined
&gt; &gt; db.transaction(function (tx) { console.log(tx) });
&gt; &lt; undefined
&gt; 
&gt; This is very awkward. All these examples works flawlessly in other browsers.
&gt; Then I tried to get the transaction outside from the function, just for
&gt; curiosity and I noticed something even more weird:
&gt; 
&gt; &gt; db.transaction(function (tx) { global_transaction = tx });
&gt; &lt; undefined
&gt; &gt; global_transaction.constructor
&gt; &lt; function Object() {
&gt;     [native code]
&gt; } = $3
&gt; &gt; global_transaction.constructor.prototype
&gt; &lt; {} = $2
&gt; 
&gt; Now I can access the constructor, but the prototype is empty. Because of
&gt; this I can't properly test my code, which uses a lot of webSQL. </span >

I don't know enough about the specifics of Javascript interfaces to know what is expected here or why WebKit differs from other browsers.

One thought, though, is that *only* Chrome and WebKit implement WebSQL natively. IE, Edge, and Firefox all do not have native support.

So if you're truly testing in something other than Chrome and WebKit, that means you're using a WebSQL polyfill instead of testing native WebSQL implementations.

<span class="quote">&gt; Do you think this also has some interference with IndexedDB? </span >

It definitely has nothing to do with IndexedDB.

<span class="quote">&gt; Exactly ALL my tests using IndexedDB fails only on Safari too, but I still have to debug
&gt; them a little bit more to correctly understand what is going on. </span >

What version of Safari? Have you tried in the Safari Technology Preview?

Once you explore that, we'd love a separate bug (or bugs) on the IndexedDB issues you're seeing.</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>