microsoft / cordova-plugin-websql

Cordova WebSQL Plugin
Other
61 stars 40 forks source link

Avoid use this(window) on WebSqlProxy #22

Closed dukex closed 9 years ago

dukex commented 9 years ago

The src/windows/WebSqlProxy.jsuse this to create a db var, but this is window and db is very common word to make reference a database opened, for example in README example:

var db = openDatabase("Todo", "", "Todo manager", dbSize, function() {
    console.log('db successfully opened or created');
});

Other example is when project has the db.js as dependency, the db.js use window.db too.

Using the module.exports as in cordova-plugin-file the db in WebSqlProxy is scoped in module

vladimir-kotikov commented 9 years ago

@dukex Thanks!