Commit e0f00ad7 authored by Romain Courteaud's avatar Romain Courteaud 🐸

Remove openDatabase error when loading jIO.

Do not display error in browser not implementing WebSQL.
WebSQLStorage will raise an error is used in such browsers.
parent 2db25474
/*global window, RSVP, Blob, XMLHttpRequest, QueryFactory, Query, atob,
FileReader, ArrayBuffer, Uint8Array */
FileReader, ArrayBuffer, Uint8Array, navigator */
(function (window, RSVP, Blob, QueryFactory, Query, atob,
FileReader, ArrayBuffer, Uint8Array) {
FileReader, ArrayBuffer, Uint8Array, navigator) {
"use strict";
if (window.openDatabase === undefined) {
window.openDatabase = function () {
throw new Error('WebSQL is not supported by ' + navigator.userAgent);
};
}
var util = {},
jIO;
......@@ -504,4 +510,4 @@
window.jIO = jIO;
}(window, RSVP, Blob, QueryFactory, Query, atob,
FileReader, ArrayBuffer, Uint8Array));
FileReader, ArrayBuffer, Uint8Array, navigator));
......@@ -11,9 +11,17 @@
equal = QUnit.equal,
module = QUnit.module,
big_string = "",
db = openDatabase('jio:qunit', '1.0', '', 2 * 1024 * 1024),
db,
j;
try {
db = openDatabase('jio:qunit', '1.0', '', 2 * 1024 * 1024);
} catch (ignore) {
}
if (db === undefined) {
return;
}
function getSpy() {
return new RSVP.Promise(function (resolve, reject) {
var spy;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment