electron/spec/fixtures/api/utility-process/eval.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

7 lines
213 B
JavaScript
Raw Normal View History

const vm = require('node:vm');
const contextObject = { result: 0 };
vm.createContext(contextObject);
vm.runInContext('eval(\'result = 42\')', contextObject);
process.parentPort.postMessage(contextObject.result);