The problem seems more specific than I had originally thought. It might have been because I was putting the js manually inside the app package.
var blankObj = new Array();
objCount = 0;
var num = this.patcher.getnamed("testNum");