feat: deleteEnvVar safe mode shim

This commit is contained in:
lohxt1 2024-11-20 18:29:19 +05:30
parent 56c3bf0899
commit 6442e3ceca

View File

@ -39,6 +39,12 @@ const addBruShimToContext = (vm, bru) => {
vm.setProp(bruObject, 'setEnvVar', setEnvVar); vm.setProp(bruObject, 'setEnvVar', setEnvVar);
setEnvVar.dispose(); setEnvVar.dispose();
let deleteEnvVar = vm.newFunction('deleteEnvVar', function (key) {
return marshallToVm(bru.deleteEnvVar(vm.dump(key)), vm);
});
vm.setProp(bruObject, 'deleteEnvVar', deleteEnvVar);
deleteEnvVar.dispose();
let getGlobalEnvVar = vm.newFunction('getGlobalEnvVar', function (key) { let getGlobalEnvVar = vm.newFunction('getGlobalEnvVar', function (key) {
return marshallToVm(bru.getGlobalEnvVar(vm.dump(key)), vm); return marshallToVm(bru.getGlobalEnvVar(vm.dump(key)), vm);
}); });