18 lines
500 B
JavaScript
18 lines
500 B
JavaScript
self.onmessage = async event => {
|
|
const { arrayBuffer, workerRoot } = event.data;
|
|
|
|
self.locateFile = wasmBinaryFile => {
|
|
if (workerRoot) {
|
|
return workerRoot + (workerRoot.endsWith('/') ? '': '/') + wasmBinaryFile;
|
|
} else {
|
|
return wasmBinaryFile;
|
|
}
|
|
};
|
|
|
|
importScripts('vcd.js');
|
|
|
|
const vcdstream = await makeVcdStream();
|
|
vcdstream.consume(arrayBuffer);
|
|
const info = vcdstream.getBasicInfo();
|
|
self.postMessage(info);
|
|
}; |