_BrunoNewFunctionInnerContext to __bruno__functionInnerContext

This commit is contained in:
lohit 2024-12-15 20:00:13 +05:30 committed by GitHub
parent dce1481185
commit 22612a7dbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,8 +18,8 @@ const JS_KEYWORDS = `
* ```js
* res.data.pets.map(pet => pet.name.toUpperCase())
*
* function(_BrunoNewFunctionInnerContext) {
* const { res, pet } = _BrunoNewFunctionInnerContext;
* function(__bruno__functionInnerContext) {
* const { res, pet } = __bruno__functionInnerContext;
* return res.data.pets.map(pet => pet.name.toUpperCase())
* }
* ```
@ -46,7 +46,7 @@ const compileJsExpression = (expr) => {
};
// param name that is unlikely to show up as a var in an expression
const param = `_BrunoNewFunctionInnerContext`;
const param = `__bruno__functionInnerContext`;
const body = `let { ${code.vars} } = ${param}; ${code.globals}; return ${expr}`;
return new Function(param, body);