I have a js library which has a set of functions. The library is in a file libary.js. I should use the library as shown below :
function (AUTH_OBJ){
var botApi= new library(AUTH_OBJ);
var value = botApi.getAttribute("num3");
var value2 = botApi.getAttribute
botApi.setInCache("multiply",789);
botApi.setAttribute("num",700);
botApi.setInCache("/numbers/data/num1",300);
botApi.setInCache("/multiply/new",5);
var fromCache = botApi.getFromCache("/numbers/data/num1")
return botApi.done();
}
The library does not have "getAttribute" function as used in the line
var value2 = botApi.getAttribute
But the code still executes. I want to throw an error when an un-declared variable is referenced in the library. I am unable to figure out a way. Please help me out.