add deleteDatabase as a subprop detect to indexedDB. #1238

Merged
merged 1 commit into from Mar 12, 2014

Projects

None yet

2 participants

@patrickkettner
Member

fixes #1227, also fixes #979

@stucox stucox and 1 other commented on an outdated diff Mar 4, 2014
feature-detects/indexeddbblob.js
@@ -24,6 +24,7 @@ define(['Modernizr', 'addTest', 'prefixed', 'test/indexeddb'], function( Moderni
var db;
if (!Modernizr.indexeddb) return false;
+ if (!Modernizr.indexeddb.deleteDatabase) return false;
@stucox
stucox Mar 4, 2014 Member

Maybe tidier as if (!(Modernizr.indexeddb && Modernizr.indexeddb.deleteDatabase)) { ... } ?

@stucox stucox commented on an outdated diff Mar 4, 2014
feature-detects/indexeddbblob.js
- };
- request.onsuccess = function() {
- db = request.result;
- try {
- db.transaction('store', 'readwrite').objectStore('store').put(new Blob(), 'key');
- supportsBlob = true;
- }
- catch (e) {
- supportsBlob = false;
- }
- finally {
- addTest('indexeddbblob', supportsBlob);
- db.close();
- indexeddb.deleteDatabase(dbname);
- }
+ if (!(Modernizr.indexeddb && Modernizr.indexeddb.deleteDatabase)) {
@stucox
stucox Mar 4, 2014 Member

Isn’t the logic the wrong way round now? I was just expecting this:

if (!(Modernizr.indexddb && Modernizr.indexeddb.deleteDatabase)) {
  return false;
}

// Then the rest
@patrickkettner
Member

thanks again for the sanity check, @stucox - good to go?

@patrickkettner
Member

ping @stucox

@stucox
Member
stucox commented Mar 12, 2014

Yep yep.

@stucox stucox merged commit 1a7d746 into Modernizr:master Mar 12, 2014

1 check passed

default The Travis CI build passed
Details
@patrickkettner patrickkettner deleted the patrickkettner:deletedb branch Mar 12, 2014
@stucox stucox referenced this pull request May 21, 2014
Closed

v3.0 release notes #805

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment