Merge pull request #3515 from lohxt1/feat/delete-env-var--safe-mode-shim

feat: deleteEnvVar safe mode shim
This commit is contained in:
lohit 2024-11-20 18:29:54 +05:30 committed by GitHub
commit 28d30b1ef7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);
}); });