[Webkit-unassigned] [Bug 156613] New: Cannot access the SQLTransaction.constructor.prototype
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Apr 14 17:08:55 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=156613
Bug ID: 156613
Summary: Cannot access the SQLTransaction.constructor.prototype
Classification: Unclassified
Product: WebKit
Version: Safari 9
Hardware: Macintosh
OS: OS X 10.11
Status: NEW
Severity: Normal
Priority: P2
Component: WebCore Misc.
Assignee: webkit-unassigned at lists.webkit.org
Reporter: d.camata at gmail.com
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.
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!
--
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/5cfa07bb/attachment.html>
More information about the webkit-unassigned
mailing list