fix: boolean, undefined, null values eval in quickjs vm (#2893)

fix: boolean, undeifned, null values in pre-request vars
This commit is contained in:
lohit
2024-08-23 16:18:41 +05:30
committed by GitHub
parent 4d55b50250
commit 44d70ca02a
7 changed files with 107 additions and 6 deletions

View File

@@ -66,7 +66,9 @@ if (!SERVER_RENDERED) {
'bru.getVar(key)',
'bru.setVar(key,value)',
'bru.deleteVar(key)',
'bru.setNextRequest(requestName)'
'bru.setNextRequest(requestName)',
'bru.getRequestVar(key)',
'bru.sleep(ms)'
];
CodeMirror.registerHelper('hint', 'brunoJS', (editor, options) => {
const cursor = editor.getCursor();

View File

@@ -6,7 +6,7 @@ import Portal from 'components/Portal';
import Modal from 'components/Modal';
import StyledWrapper from './StyledWrapper';
const JsSandboxModeModal = ({ collection, onClose }) => {
const JsSandboxModeModal = ({ collection }) => {
const dispatch = useDispatch();
const [jsSandboxMode, setJsSandboxMode] = useState(collection?.securityConfig?.jsSandboxMode || 'safe');
@@ -22,7 +22,6 @@ const JsSandboxModeModal = ({ collection, onClose }) => {
)
.then(() => {
toast.success('Sandbox mode updated successfully');
onClose();
})
.catch((err) => console.log(err) && toast.error('Failed to update sandbox mode'));
};