createCachedData is not implemented
entrptaher opened this issue · 1 comments
entrptaher commented
const vm = require("vm");
let script = new vm.Script("console.log('hello world')", { produceCachedData: true });
console.log(script.createCachedData());
This fails because it's not implemented yet. We can run bytecode inside browser if this is implemented.
This is implemented here on node source, https://github.com/nodejs/node/blob/0e715dea84d67a24624516c730aa71ed04971727/src/node_contextify.cc#L787
Is it possible to implement this on vm-browserify?
goto-bus-stop commented
I'm not aware of any way to do this in the browser, no. There is no cross platform API for bytecode caches.