doc-idb-run-to-completion.html (817B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script> 5 function test() { 6 var DBOpenRequest = window.indexedDB.open("toDoList", 5); 7 DBOpenRequest.onupgradeneeded = function(event) { 8 var db = DBOpenRequest.result; 9 db.createObjectStore("toDoList"); 10 }; 11 12 DBOpenRequest.onsuccess = function(event) { 13 var db = DBOpenRequest.result; 14 var transaction = db.transaction(["toDoList"], "readwrite"); 15 16 // This will trigger the debugger's onNewScript which will save the 17 // microtask queue and perform one or more microtask checkpoints. 18 eval("var newScript;"); 19 20 // If IDB transactions were processed by the debugger's microtask 21 // checkpoints then this store will throw an exception. 22 transaction.objectStore("toDoList"); 23 24 debugger; 25 }; 26 } 27 </script> 28 </head> 29 <body>loading...</body> 30 </html>