global_noscoping
Version:
noscopes the global variables you define
24 lines (20 loc) • 776 B
JavaScript
;
//YEAH LETS FIND THESE CRAP GLOBALS
var JUSTDOITINGLOBALSCOPE = function(){
console.log("well shit, we're in strict mode. Guess we can't do anything because i can't make any globals.")
console.log("YOLO!!")
try {
//Activate YOLO
JUST_FUCK_MY_SHIT_UP_FAM = "THIS WILL NOT THROW AN ERROR"
} catch (e) {
//Deal with the problems with YOLOing
throw new FUCKJAVASCRIPTERROR("wtf use strict why u do this to me i just wanna make globals")
}
}
//This is what all errors should be like
var FUCKJAVASCRIPTERROR = function(message){
this.name = "FUCK_JAVASCRIPT";
this.message = message || "FUCK_JAVASCRIPT_IS_BAD";
this.stack = (new Error()).stack
}
exports.JUSTDOITINGLOBALSCOPE = JUSTDOITINGLOBALSCOPE