Skip to content

Instantly share code, notes, and snippets.

@patakijv
Created December 27, 2011 23:52
Show Gist options
  • Save patakijv/1525509 to your computer and use it in GitHub Desktop.
Save patakijv/1525509 to your computer and use it in GitHub Desktop.
Global Variables Test
var MY_BLUE = "#26A9E0";
var module = require("module");
Ti.API.info("[APP] info is "+JSON.stringify(module.info));
var info = {
color:"blue",
value:MY_BLUE
};
exports.info = info;
Ti.API.info("[MODULE] info is "+JSON.stringify(info));
Error dialog indicating that an Uncaught ReferenceError was thrown with a message: MY_BLUE is not defined
[MODULE] info is {"color":"blue","value":"#26A9E0"}
[APP] info is {"color":"blue","value":"#26A9E0"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment