Skip to content

Instantly share code, notes, and snippets.

@appcypher
Last active December 21, 2021 08:52
Show Gist options
  • Save appcypher/2c210cd04774f1812a4b3e5c84496858 to your computer and use it in GitHub Desktop.
Save appcypher/2c210cd04774f1812a4b3e5c84496858 to your computer and use it in GitHub Desktop.
Accessing the Global Scope
function main() {
const { log } = Tera;
log.info(">>> authenticating ...");
return true;
})() // Close the parens prematurely.
// Do globally things.
var leak = 5;
// Create an open parens that matches the closing parens.
(function() { return true; }
function main() {
const { log } = Tera;
log.info(">>> middlewaring ...");
log.info(">>> leak =", leak); // Access previously leaked value
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment