(a,b)
| 71 | function(){setTimeout(()=>{this.do_tick()},0)},register_tick=function(){},unregister_tick=function(){};v86.prototype.fast_next_tick=fast_next_tick;v86.prototype.register_tick=register_tick;v86.prototype.unregister_tick=unregister_tick;var next_tick="undefined"!==typeof document&&"boolean"===typeof document.hidden?function(a){4>a||document.hidden?this.fast_next_tick():setTimeout(()=>{this.do_tick()},a)}:function(a){setTimeout(()=>{this.do_tick()},a)};v86.prototype.next_tick=next_tick; |
| 72 | v86.prototype.save_state=function(){return this.cpu.save_state()};v86.prototype.restore_state=function(a){return this.cpu.restore_state(a)};if("object"===typeof performance&&performance.now)v86.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");v86.microtick=a.now.bind(a)}else v86.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;var goog=goog||{};goog.exportSymbol=function(){};goog.exportProperty=function(){};var v86util=v86util||{};v86util.pads=function(a,b){return(a||0===a?a+"":"").padEnd(b," ")};v86util.pad0=function(a,b){return(a||0===a?a+"":"").padStart(b,"0")};v86util.zeros=function(a){return Array(a).fill(0)};v86util.range=function(a){return Array.from(Array(a).keys())}; |
| 73 | v86util.view=function(a,b,c,d){return new Proxy({},{get:function(e,f,k){e=new a(b.buffer,c,d);k=e[f];if("function"===typeof k)return k.bind(e);dbg_assert(/^\d+$/.test(f)||"buffer"===f||"length"===f||"BYTES_PER_ELEMENT"===f||"byteOffset"===f);return k},set:function(e,f,k,g){dbg_assert(/^\d+$/.test(f));(new a(b.buffer,c,d))[f]=k;return!0}})};function h(a,b){a=a?a.toString(16):"";return"0x"+v86util.pad0(a.toUpperCase(),b||1)} |
| 74 | if("undefined"!==typeof crypto&&crypto.getRandomValues){let a=new Int32Array(1);v86util.get_rand_int=function(){crypto.getRandomValues(a);return a[0]}}else if("undefined"!==typeof require){const a=require("crypto");v86util.get_rand_int=function(){return a.randomBytes(4).readInt32LE(0)}}else dbg_assert(!1,"Unsupported platform: No cryptographic random values");function SyncBuffer(a){dbg_assert(a instanceof ArrayBuffer);this.buffer=a;this.byteLength=a.byteLength;this.onprogress=this.onload=void 0} |
| 75 | SyncBuffer.prototype.load=function(){this.onload&&this.onload({buffer:this.buffer})};SyncBuffer.prototype.get=function(a,b,c){dbg_assert(a+b<=this.byteLength);c(new Uint8Array(this.buffer,a,b))};SyncBuffer.prototype.set=function(a,b,c){dbg_assert(a+b.byteLength<=this.byteLength);(new Uint8Array(this.buffer,a,b.byteLength)).set(b);c()};SyncBuffer.prototype.get_buffer=function(a){a(this.buffer)}; |
| 76 | SyncBuffer.prototype.get_state=function(){const a=[];a[0]=this.byteLength;a[1]=new Uint8Array(this.buffer);return a};SyncBuffer.prototype.set_state=function(a){this.byteLength=a[0];this.buffer=a[1].slice().buffer}; |
no test coverage detected