-
-
Save OMGZui/066bbf20b3c8cba31f264f001b75b8b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = "foo1"; | |
const ctx = { | |
func: variable => { | |
console.log(variable); | |
}, | |
foo: "f1" | |
}; | |
function veryPoorSandbox(code, ctx) { | |
with (ctx) { | |
eval(code); | |
} | |
} | |
const code = `func(foo)`; | |
veryPoorSandbox(code, ctx); | |
// f1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment