Created
March 3, 2025 18:31
-
-
Save hotsphink/97b932af72d8642e3e34871248f7ca94 to your computer and use it in GitHub Desktop.
mkgist-created gist
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
g = newGlobal({ newCompartment: true }); | |
dbg = new Debugger(); | |
dbg.addDebuggee(g); | |
dbg.onNewScript = (script) => { | |
const src = script.source; | |
const h = Object.create(null); | |
for (const prop of Object.getOwnPropertyNames(src.__proto__)) { | |
Math.sin(src); | |
try { | |
h[prop] = src[prop]; | |
} catch (e) {} | |
} | |
print(JSON.stringify(h)); | |
}; | |
g.eval(`function f() { return "♬"; }`); | |
g.eval(`function f2() { return "x"; }`); | |
print(g.f); | |
print(g.f2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment