mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
feat: safe mode updates
This commit is contained in:
parent
3b3fa8a856
commit
9955b8796e
@ -4,7 +4,6 @@ const addBrunoRequestShimToContext = require('./shims/bruno-request');
|
||||
const addConsoleShimToContext = require('./shims/console');
|
||||
const addBrunoResponseShimToContext = require('./shims/bruno-response');
|
||||
const addTestShimToContext = require('./shims/test');
|
||||
const fs = require('fs');
|
||||
const addLibraryShimsToContext = require('./shims/lib');
|
||||
|
||||
// execute `npm run build:isolated-vm:inbuilt-modules` if the below file doesn't exist
|
||||
@ -243,12 +242,16 @@ const executeInIsolatedVMAsync = async ({
|
||||
await context.global.set('global', context.global.derefInto());
|
||||
|
||||
context.evalSync(`
|
||||
let bru = {};
|
||||
let req = {};
|
||||
let res = {};
|
||||
let console = {};
|
||||
global.requireObject = {};
|
||||
`);
|
||||
let bru = {};
|
||||
let req = {};
|
||||
let res = {};
|
||||
let console = {};
|
||||
global.requireObject = {};
|
||||
global.require = (module) => {
|
||||
return global.requireObject[module];
|
||||
}
|
||||
`);
|
||||
await addLibraryShimsToContext(this.context);
|
||||
|
||||
context.global.setSync('log', function (...args) {
|
||||
console.debug(...args);
|
||||
|
Loading…
Reference in New Issue
Block a user