JSFiddle - React, Tailwind, and code Playground
HTML
<div id="status">
</div>
JavaScript
function module()
{
this.init = function(libraries)
{
for (var key in libraries) {
eval(key + " = libraries[key]")
var test = {test:"I shouldn't be here"}
}
oauth.log('yay!');
};
this.test = function() {
oauth.log(JSON.stringify(oauth))
oauth.log(JSON.stringify(test))
};
}
function app()
{
var api = {};
var oauth = {
test : "I shouldn't work"
};
var db = {};
oauth.log = function(input) {
element = document.createTextNode(input)
document.getElementById("status").appendChild(element)
};
var libraries = {
api : api,
db : db,
oauth : oauth,
};
var mod = new module();
mod.init(libraries);
mod.test()
}
var app = new app();