Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge remote branch 'upstream/master'

  • Loading branch information...
commit 12b56aaa95866a10c5d28ff29728839df60e48ad 2 parents 3a18481 + f47209e
@rsaccon authored
Showing with 6 additions and 9 deletions.
  1. +5 −8 lib/persistence.js
  2. +1 −1  test/node-blog.js
View
13 lib/persistence.js
@@ -24,22 +24,19 @@
*/
// Some set-up code for non-browser environments
-try {
- if(!window) {
- window = {};
- //exports.console = console;
- }
-} catch(e) {
+if(typeof window === 'undefined') {
window = {};
+}
+if(typeof exports !== 'undefined') {
exports.console = console;
}
var persistence = (window && window.persistence) ? window.persistence : createPersistence();
-try {
+if(typeof exports !== 'undefined') {
exports.createPersistence = createPersistence;
exports.persistence = persistence;
-} catch(e) {}
+}
function createPersistence() {
var persistence = {};
View
2  test/node-blog.js
@@ -35,7 +35,7 @@ var persistence = require('persistencejs/persistence').persistence;
var persistenceStore = require('persistencejs/persistence.store.mysql');
// Database configuration
-persistenceStore.config(persistence, 'localhost', 'nodejs_mysql', 'test', 'test');
+persistenceStore.config(persistence, 'localhost', 3306, 'nodejs_mysql', 'test', 'test');
// Switch off query logging:
//persistence.db.log = false;
Please sign in to comment.
Something went wrong with that request. Please try again.