Skip to content

Instantly share code, notes, and snippets.

Last active Aug 31, 2021
What would you like to do?
Run jscode from string in sandbox
function sandboxcode(s) {
function construct(c, a) {
function F(){return c.apply(this, a)}
F.prototype = c.prototype;
return new F()
let g = ["Function","globalThis","eval"]
for (let i in globalThis){g.push(i)}
return construct(Function, g).apply({});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment