[Webkit-unassigned] [Bug 156613] Cannot access the SQLTransaction.constructor.prototype

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 14 20:33:22 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156613

--- Comment #1 from Brady Eidson <beidson at apple.com> ---
(In reply to comment #0)
> In any other browser, I can access and modify
> SQLTransaction.constructor.prototype, like this:
> 
> > var db = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024);
> < undefined
> > db.transaction(function (tx) { console.log(tx.constructor.prototype) });
> < undefined
> -> SQLTransaction {Symbol(Symbol.toStringTag): "SQLTransaction"}
> 
> 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 "TypeError: Attempted to wrap
> undefined property executeSql as function". 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:
> 
> > db.transaction(function (tx) { console.log(tx.constructor.prototype) });
> < undefined
> > db.transaction(function (tx) { console.log(tx.constructor) });
> < undefined
> > db.transaction(function (tx) { console.log(tx) });
> < 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:
> 
> > db.transaction(function (tx) { global_transaction = tx });
> < undefined
> > global_transaction.constructor
> < function Object() {
>     [native code]
> } = $3
> > global_transaction.constructor.prototype
> < {} = $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. 

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.

> Do you think this also has some interference with IndexedDB? 

It definitely has nothing to do 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. 

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160415/68521f68/attachment.html>


More information about the webkit-unassigned mailing list