1<!doctype html> 2<html lang="en-us"> 3 <head> 4 <meta charset="utf-8"> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> 7 <link rel="stylesheet" href="../common/emscripten.css"/> 8 <link rel="stylesheet" href="../common/testing.css"/> 9 <title>sqlite3 tester #1 (Worker thread)</title> 10 <style> 11 body { 12 font-family: monospace; 13 } 14 </style> 15 </head> 16 <body> 17 <h1>sqlite3 WASM/JS tester #1 (Worker thread)</h1> 18 <script>(function(){ 19 const logHtml = function(cssClass,...args){ 20 const ln = document.createElement('div'); 21 if(cssClass) ln.classList.add(cssClass); 22 ln.append(document.createTextNode(args.join(' '))); 23 document.body.append(ln); 24 }; 25 const w = new Worker("tester1.js"); 26 w.onmessage = function({data}){ 27 switch(data.type){ 28 case 'log': 29 logHtml(data.payload.cssClass, ...data.payload.args); 30 break; 31 default: 32 logHtml('error',"Unhandled message:",data.type); 33 }; 34 }; 35 })();</script> 36 </body> 37</html> 38