Created
June 14, 2015 21:18
-
-
Save nolanlawson/5e397897633f9e16eb42 to your computer and use it in GitHub Desktop.
Repro Webkit #136888
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<h1> Repro Webkit bug <a href='https://bugs.webkit.org/show_bug.cgi?id=136888'>136888</a> </h1> | |
<p>If you see the text <strong>There's a bug</strong>, then there's a bug.</p> | |
<div id="logger"></div> | |
<script> | |
var dbname = 'rando_' + Math.random() + '_'; | |
function log(msg) { | |
document.getElementById("logger").innerHTML += msg + "<br>"; | |
} | |
var request1 = indexedDB.open(dbname + "1"); | |
request1.onupgradeneeded = function(e) { | |
log("First request: " + e.oldVersion + " " + e.newVersion); | |
if (!(e.oldVersion === 0 && e.newVersion === 1)) { | |
log("<strong>Request 1: There's a bug</strong>"); | |
} | |
} | |
var request2 = indexedDB.open(dbname + "2", 1); | |
request2.onupgradeneeded = function(e) { | |
log("Second request: " + e.oldVersion + " " + e.newVersion); | |
if (!(e.oldVersion === 0 && e.newVersion === 1)) { | |
log("<strong>Request 2: There's a bug</strong>"); | |
} | |
} | |
var request3 = indexedDB.open(dbname + "3", 2); | |
request3.onupgradeneeded = function(e) { | |
log("Third request: " + e.oldVersion + " " + e.newVersion); | |
if (!(e.oldVersion === 0 && e.newVersion === 2)) { | |
log("<strong>Request 3: There's a bug</strong>"); | |
} | |
} | |
try { | |
var request = indexedDB.open(dbname + "4", 0); | |
log("<strong>Request 4: There's a bug</strong>"); | |
} catch (e) { | |
log("0 version: " + e); | |
} | |
try { | |
var request = indexedDB.open(dbname + "5", -1); | |
log("<strong>Request 5: There's a bug</strong>"); | |
} catch (e) { | |
log("Negative version: " + e); | |
} | |
try { | |
var request = indexedDB.open(dbname + "6", "string"); | |
log("<strong>Request 6: There's a bug</strong>"); | |
} catch (e) { | |
log("String version: " + e); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment