This commit is contained in:
Pooja Belaramani 2025-01-28 18:06:01 +05:30
parent d8a01b5749
commit bc784aaa85
2 changed files with 7 additions and 7 deletions

View File

@ -73,7 +73,7 @@ class Bru {
throw new Error('Creating a env variable without specifying a name is not allowed.');
}
if(!value) {
if (value === undefined) {
throw new Error('Creating a env variable without specifying a value is not allowed.');
}
@ -93,7 +93,7 @@ class Bru {
throw new Error('Creating a env variable without specifying a name is not allowed.');
}
if(!value) {
if (value === undefined) {
throw new Error('Creating a env variable without specifying a value is not allowed.');
}
@ -109,7 +109,7 @@ class Bru {
throw new Error('Creating a variable without specifying a name is not allowed.');
}
if(!value) {
if (value === undefined) {
throw new Error('Creating a variable without specifying a value is not allowed.');
}

View File

@ -39,7 +39,7 @@ const addBruShimToContext = (vm, bru) => {
if (!key) {
throw new Error('Creating a env variable without specifying a name is not allowed.');
}
if (!value) {
if (value === undefined) {
throw new Error('Creating a env variable without specifying a value is not allowed.');
}
bru.setEnvVar(vm.dump(key), vm.dump(value));
@ -60,10 +60,10 @@ const addBruShimToContext = (vm, bru) => {
getGlobalEnvVar.dispose();
let setGlobalEnvVar = vm.newFunction('setGlobalEnvVar', function (key, value) {
if(!key) {
if (!key) {
throw new Error('Creating a env variable without specifying a name is not allowed.');
}
if(!value) {
if (value === undefined) {
throw new Error('Creating a env variable without specifying a value is not allowed.');
}
bru.setGlobalEnvVar(vm.dump(key), vm.dump(value));
@ -87,7 +87,7 @@ const addBruShimToContext = (vm, bru) => {
if (!key) {
throw new Error('Creating a env variable without specifying a name is not allowed.');
}
if (!value) {
if (value === undefined) {
throw new Error('Creating a env variable without specifying a value is not allowed.');
}
bru.setVar(vm.dump(key), vm.dump(value));