Wednesday, 15 March 2017

How can I run javascript code with limit function acesse

sorry for my bad english

I want to load a javascript file as a script for a specific task and it should only able to access specific function that I defined.

I don't want people who write the code access to global objects like process or some global function.

I only want users to use functions or objects that I prepare for them, and it should allow them to define their own functions and variables, others are not allowed.

Is there some package could do it?

for example:

process; // should be undefined
getProcessInfo(); // the function that I prepared for them

var process = 0; // should be ok



via Kiochan

No comments:

Post a Comment