Cordova-sqlite-storage: executeSQL arguments from iFrame are always empty

Created on 24 Aug 2018  路  2Comments  路  Source: storesafe/cordova-sqlite-storage

When using an iFrame, all the arguments in executeSQL are never sent.

I found that in SQLitePlugin.js the following validation was returning FALSE:

line 363: values.constructor === Array

This seems due to the fact that Array objects created within one iframe do not share [[Prototype]]鈥檚 with arrays created within another iframe.

As a solution i think this could be used instead:

Array.isArray(values)

bug-general doc-todo testing doc-general

All 2 comments

馃憤
I found the same problem and the same solution with a gwt project.
I have also modified :

line 268 : if (!sqlStatements || sqlStatements.constructor !== Array) {
to
if (!sqlStatements || !Array.isArray(sqlStatements)) {
and
line 275: if (st.constructor === Array) {
to
if (Array.isArray(st)) {

Thanks for reporting. I hope to fix this in the next major release in December 2018 ref: #773

ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maoamid picture maoamid  路  4Comments

PterPmnta picture PterPmnta  路  4Comments

iacobliviu picture iacobliviu  路  6Comments

jreynerio picture jreynerio  路  5Comments

MASP3000 picture MASP3000  路  4Comments